Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SEQUENCE
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