Skip to Content
0
Jul 03, 2015 at 03:36 PM

Simple TRIGGER... not working !?

266 Views

Hello,

I'm new in SQL so I try to do some basic stuff.

I have created a sequence and I want to increment the sequence in a trigger, here is my code :

create trigger <my_schema>."myTrigger" before insert 
on <my_schema>."COMMENT" 
referencing new row newrow
for each row begin
  select <my_schema>."my_sequence".NEXTVAL into :NEWROW.ID from dummy;
end

Is someone can explain me why it doesn't work ?

Here is the error :

Could not execute 'create trigger <my_schema>."myTrigger" before insert on ...'

SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near ":NEWROW": line 5 col 85 (at pos 255)

Kind regards,