Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: a trigger to increment key ????
"Jerome Carpene" <jerome.carpene_at_aliso.com> wrote in message
news:8nubn9$cf5$2_at_wanadoo.fr...
> Well I intend to use a trigger to compute the new row >
[snip]
> otherwise how to have that kind of auto increment key ?
>
> Thanks for your help :))
>
> --
> Jérôme CARPENE
>
>
Use a sequence
create sequence fooseq start with 1 increment by 1; -- etc.
grant select on <anyone needs to have access to it>;
create (public synonym) fooseq for fooseq;
use
select fooseq.nextval
into :new.<key column>
from dual;
in your trigger.
That should be all.
Hth,
Sybrand Bakker, Oracle DBA Received on Tue Aug 22 2000 - 12:10:56 CDT
![]() |
![]() |