Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> How do I CREATE TRIGGER?
I'm trying to create a trigger to autonumber an id field.
In svrmgrl, I wrote:
create trigger trig1 before insert of id on testtab2
2> DECLARE 3> BEGIN 4> insert into testtab2 (id) values (headid.nextval); 5> END; 6> ;
Am I going about this the right way? (headid is a sequence btw)
From the docs, it takes a PL/SQL block. I don't know the first thing
about PL/SQL.
When I press return, it doesn't go back to the SVRMGR> prompt, so I
can't even test whether the command is right. How do I get back to the
SVRMGR> prompt, and make it recognise this as a command?
Thanks,
![]() |
![]() |