Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NEWBIE needs help on autonumber
A copy of this was sent to pee_bee_at_my-dejanews.com
(if that email address didn't require changing)
On Sat, 06 Mar 1999 01:53:24 GMT, you wrote:
>Hi,
>Finally my boss have given me ORacle, so I can get rid of my MickeySoft shit.
>There is only one problem, how do I implement a autonumber field ??
>
create sequence my_seq;
create trigger my_trigger
before insert on my_table
for each row
begin
select my_seq.nextval into :new.primary_key from dual;
end;
/
where primary_key is the name of the column needing the autonumber.
>I can't find anything in the manuals ( as if you can find anything in it :)
>
>Please help
>
>Pb
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities
![]() |
![]() |