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

Home -> Community -> Usenet -> c.d.o.server -> Generating unique key numbers

Generating unique key numbers

From: Michal Motalík <cross_at_zl.inext.cz>
Date: 1997/11/29
Message-ID: <01bcfcdc$3a121700$LocalHost@michal>#1/1

I am developing a client/server project which will run on both  Interbase and Oracle. I wrote a trigger which sets unique numbers  from generator to primary index column on Interbase. I want to  write similar trigger on Oracle but i have a problem.

I can not create trigger:

CREATE TRIGGER tabtrig
BEFORE INSERT ON tab
FOR EACH ROW
BEGIN
  :NEW.id := tabseq.NEXTVAL;
END; The sequence "tabseq" was created.
I get the error PLS-00357.
(reference to sequence is not permitted in these context)

Does anybody know where the problem is?

                          
Michal Motalík
cross_at_zl.inext.cz Received on Sat Nov 29 1997 - 00:00:00 CST

Original text of this message

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