Re: Auto increment primary key

From: Gooli <gooli_at_mailandnews.com>
Date: 2000/06/09
Message-ID: <8hqpki$ihj$1_at_news.netvision.net.il>#1/1


You should create a sequence:

create sequence emp_no_seq;

By defult it increments by 1 starting at 0, and use its values when inserting data into the table:

insert into t_emp values (emp_no_seq.nexval, 'Joe Black');

jAw wrote in message ...
>probably a basic question, but i cant find out how to do it ... so if
 anyone
>can help out it would be most appreciated
>
>ie., how to auto increment a primary key eg. for product_id, customer_id
>etc.
>
>thanks heaps
>
>jawax_at_optushome_nospam.com.au
>
>
Received on Fri Jun 09 2000 - 00:00:00 CEST

Original text of this message