I can't get a trigger to compile. What am I doing wrong?
I want to use a sequence to generate a Primary Key on a table. I want the trigger to fire BEFORE INSERT FOR EACH ROW and use the sequence.NEXTVAL as the value of the PR KEY.
What's the correct syntax please folks?
I'm using 8.1.5
My code is ...
1 CREATE OR REPLACE TRIGGER HELP_DESK_ID_INS_TRG
2 BEFORE INSERT ON HELP_DESK_CALLS
3 FOR EACH ROW
5 V_SeqVal Number;
7 Select HELP_DESK_SEQ.NEXTVAL Into V_SeqVal From Dual;
8 :New.call_id = V_SeqVal;
Warning: Trigger created with compilation errors.
:New.call_id = V_SeqVal;
the above statment should be
:New.call_id := V_SeqVal;
the colon is missing
Can you believe it!
Thanks for the extra pair of eyes!
Click Here to Expand Forum to Full Width