-
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
4 Declare
5 V_SeqVal Number;
6 BEGIN
7 Select HELP_DESK_SEQ.NEXTVAL Into V_SeqVal From Dual;
8 :New.call_id = V_SeqVal;
9* END;
10 /
Warning: Trigger created with compilation errors.
-
Hi
Try this
:New.call_id = V_SeqVal;
the above statment should be
:New.call_id := V_SeqVal;
the colon is missing
Regards
Santosh
-
!!!!
Can you believe it!
Thanks for the extra pair of eyes!
JM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|