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 -> Seqence Number in Triggers Please Help

Seqence Number in Triggers Please Help

From: ProCard, Inc. <AROBBINS_at_PROCARD.COM>
Date: 1998/03/10
Message-ID: <01bd4c31$8271da90$7f5585cc@arobbins>#1/1

Every time a record is inserted into a table I would like the trigger to update the PK before insert with a sequence number. We are unable to alter our current insert statements to complete the operation. The inserts are also used on Ms Sql Server and Ms Access. Below I have listed some examples that do not work yet. Please help.

Andy Robbins
ProCard Inc
arobbins_at_procard.com


CREATE OR REPLACE TRIGGER TR_ANDY_TEST
 BEFORE INSERT ON TB_ANDY_TEST
  FOR EACH ROW
   BEGIN
     :NEW.DT= DT_SEQ.NEXTVAL
   END;
/

CREATE OR REPLACE TRIGGER TR_ANDY_TEST
 BEFORE INSERT ON TB_ANDY_TEST
  FOR EACH ROW
  DECLARE newrow number;

   BEGIN
   newrow = DT_SEQ.NEXTVAL
   END;/ Received on Tue Mar 10 1998 - 00:00:00 CST

Original text of this message

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