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: sequnce as an id

Re: sequnce as an id

From: Nina Wiesemann <nw.th_at_rhein-main.net>
Date: Fri, 19 Mar 1999 20:03:29 +0100
Message-ID: <7cu738$3sm$1@newsreader.ipf.de>


You have to write a before insert row-level trigger and set the sequence value there

N. Wiesemann



Im Beitrag <7crvun$ls3$1_at_winter.news.rcn.net>, "Ed Zappulla" <zappullae_at_rcn.com> schrieb:

>Does anyone know how to specifiy a sequence as a default value for a primary
>key id? I want to do an auto number without having to explicitly set the
>value for each insert. ie:
>
>create sequence seq_id;
>
>create table x
>(
> id number default x.nextval not null, ---- bad syntax.
>how to do this?
> name varchar2(255) not null
>);
>
>insert into x (name) values ('xxxx');
>
>
>
Received on Fri Mar 19 1999 - 13:03:29 CST

Original text of this message

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