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 -> Re: SEQUENCE

Re: SEQUENCE

From: <rtgraf_at_sintec.de>
Date: Wed, 17 Jun 1998 14:22:01 GMT
Message-ID: <6m8je8$cka$1@nnrp1.dejanews.com>


In article <6m856c$o11$1_at_nnrp1.dejanews.com>,   vjoshi_at_pinnacle.co.uk wrote:
>
> Is there a way of including the next sequence number as a default value within
> create table statement ?
>
> Many thanks in advance
>

Sorry, no *direct* one. You have to implement triggers to fetch from the sequence, e.g.
CREATE TRIGGER tbi_your_table
BEFORE INSERT ON your_table
FOR EACH ROW
BEGIN
  SELECT your_sequence.nextval INTO :new.your_column   FROM dual;
END;
Hope this helps, Robert.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Wed Jun 17 1998 - 09:22:01 CDT

Original text of this message

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