create sequence supplier_seq
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;
this would create a sequence object called supplier_seq. the first sequence number that it would use is 1 and each subsequent number would increment by 1 (ie: 2,3,4,...}. it will cache up to 20 values for performance.
now that you've created a sequence object to simulate an autonumber field, we'll cover how to retrieve a value from this sequence object. to retrieve the next value in the sequence order, you need to use nextval.
for example:
supplier_seq.nextval
this would retrieve the next value from supplier_seq. the nextval statement needs to be used in an sql statement. for example:
insert into suppliers
(supplier_id, supplier_name)
values
(supplier_seq.nextval, 'kraft foods');