Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How do I CREATE TRIGGER?

How do I CREATE TRIGGER?

From: kev <kevin.porter_at_fast.no>
Date: Wed, 28 Jul 1999 16:25:13 +0100
Message-ID: <379F20D9.DC436A19@fast.no>


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,

Received on Wed Jul 28 1999 - 10:25:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US