Home > database >  Oracle to write a trigger
Oracle to write a trigger

Time:09-21

Oracle to write row-level trigger, the trigger are generated, but at the time of use to trigger inactive;
The CREATE
OR REPLACE the TRIGGER ZDRCFQ AFTER INSERT ON RY_ZDRKXX FOR EACH ROW

WHEN (NEW. GKZTDM='3' AND NEW. CZBS & lt; '3' AND NEW. GMSFHM IS NOT NULL)
The BEGIN
INSERT INTO RY_BQB (BQBH, RYBH GMSFHM, XXBH, XXLB, RYBQDM, BZ, CZDW, CZR, CZSJ, CZBS, RYBQLB)
VALUES
(
The SELECT (sys_guid () FROM dual), NEW. RYBH, : NEW. GMSFHM, : NEW. ZDRKBH,
'the key population,
'01' : NEW. BZ, : NEW. CZDW, : NEW. CZR, : NEW. CZSJ, : NEW. CZBS,
'0'
);
END;

For the first time to write the oracle trigger, a great god help me to see what is wrong

CodePudding user response:

The report is invalid without through revalidation

CodePudding user response:

Report is invalid without through revalidation, look not to understand
The specific error message?

CodePudding user response:

Trigger to compile a success?
I saw a less declare

CodePudding user response:

Two table DDL to stick,

CodePudding user response:

1, less declare
2, WHEN (NEW. GKZTDM='3' AND NEW. CZBS & lt; '3' AND NEW. GMSFHM IS NOT NULL) into the if
3, the judgment of the above statements should be behind the begin
4, the SELECT sys_guid () FROM dual) to direct reference sys_guid ()

CodePudding user response:

To fifth floor

The original poster wrote the when should be followed For each row, he more than a blank line, don't need to use the if

CodePudding user response:

Oracle trigger

http://www.verejava.com/? Id=17173797331956
  • Related