Re: How mimic autonumber for IDs?

From: Matt Mason <m.mason_at_CBetter.com>
Date: Fri, 09 Mar 2001 21:51:51 GMT
Message-ID: <Xfcq6.30925$jg1.666069_at_news1.alsv1.occa.home.com>


Jim-

   I created my sequence and a trigger doing this, but how do I increment my sequence? Each time I keep getting 1 as the new ID:

create sequence TEST_SEQ start with 1;
  CREATE OR REPLACE TRIGGER MY_TEST_TRG
  BEFORE INSERT on MY_TEST_TABLE
   FOR EACH ROW
   BEGIN
   SELECT TEST_SEQ.NEXTVAL

   INTO :NEW.ID FROM DUAL;
  END MY_TEST_TRG; Jim Kennedy <kennedy-family_at_home.com> wrote in message news:ywWp6.529210$U46.15894364_at_news1.sttls1.wa.home.com...
> Use sequences. I think this has been addresses at least 1/week in this
> newsgroup.
> Jim
>
Received on Fri Mar 09 2001 - 22:51:51 CET

Original text of this message