Re: Sequence Number and Triggers

From: Rob van den Berg <rvdb_at_gni.ns.nl>
Date: 1998/03/10
Message-ID: <6e3npe$6vd_at_charon.cvi.ns.nl>#1/1


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

Rob van den Berg (rvdb_at_gni.ns.nl)
N.V. Nederlandse Spoorwegen
Geodesie & Infradata

ProCard, Inc. wrote in message <01bd4c32$0bc668b0$7f5585cc_at_arobbins>...
>
>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
>====================

(skip..) Received on Tue Mar 10 1998 - 00:00:00 CET

Original text of this message