Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Clarification of 'Sequences'
Good Day,
I have reasonable experience with both PostgreSQL and Micrsoft SQLServer. WIth both I can create a column in a table that automatically generates a unique count value. That is:
in MSSQL, i do:
create tabel test1( id int identity(1,1) not null, value varchar(80) );
in PostgreSQL, it is slightly more complex, but similar to:
create sequence seq_id start 1 increment 1; create table test2( id int4 default nextval('seq_id') not null, value varchar(80)
);
now, in Oracle 8.0.4 (on Solaris), i believe that i must do something similar to the PostgreSQL case. I start with:
create sequence seq_id start with 1 increment by 1;
and then (?????)
create table
id int default seq_id.nextval not null, value varchar(80)
);
but this gets me an error saying that i cannot include a column name (seq_id) in the table definition.
now, i conclude that if both MSSQL and PostgreSQL can do this (as shown above) there has to be a 'graceful' way to get Oracle to do it also.
please help!!!
thanks in advance,
steve
Received on Wed Sep 30 1998 - 00:00:00 CDT
![]() |
![]() |