Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: auto-incremental fields ?
A copy of this was sent to "AGRISOFT/ABSILOG" <andreu_at_club-internet.fr>
(if that email address didn't require changing)
On Mon, 8 Feb 1999 19:44:38 +0100, you wrote:
> if the best way to have auto-incremental field for my primary key is to
>fire a trigger, what could be this good trigger ?
>
> if u have one be pleased to send it to me...
>
>jo :)
>
>thx !!!
>
SQL> create sequence my_sequence;
SQL> create or replace trigger my_trigger > before insert on T > for each row > begin > select my_sequence.nextval into :new.my_primary_key from dual; > end; > /
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Feb 08 1999 - 18:33:42 CST
![]() |
![]() |