Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: auto increment...

Re: auto increment...

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 8 Dec 2000 22:57:06 +0100
Message-ID: <90rmvv$2825k$1@ID-62141.news.dfncis.de>

create trigger foobri before insert on foo for each row begin
select fooseq.nextval
into :new.id
from dual;
end;
/
and that's all there is.

Regards,

Sybrand Bakker, Oracle DBA

<schnurmann_at_my-deja.com> wrote in message news:90rju2$6pg$1_at_nnrp1.deja.com...
> Ok, I'm lost. According to the docs the use of a sequence is good as a
> primary key. For the life of me I cannot create a table that uses the
> sequence. In mySQL this is so easy with auto_increment. How does one
> do this in Oracle??
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Dec 08 2000 - 15:57:06 CST

Original text of this message

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