Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: auto increment...
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
![]() |
![]() |