Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: equivalent of identity(MS-SQL2000) in oracle
for your increment problem you need to create a SEQUENCE on the database. Have a look in your manuals for SEQUENCE.
pehaw.
In article <940727$gmp$1_at_nnrp1.deja.com>,
iluzn_at_my-deja.com wrote:
> i am in the proccess of converting my database routines to suit an
> oracle database. The old DBMS used is microsoft sql server 2000.
> the statement identity is used to automatically increment a column
> sequencially so that the field is kept unique.
>
> CREATE TABLE employees
> (Empno INT IDENTITY,
> firstName VARCHAR(30),
> lastName VARCHAR(30))
>
> to then add a record you need only specify the other fields
>
> INSERT INTO employees(firstName,lastName) VALUES ('Bob', 'Smith')
> INSERT INTO employees(firstName,lastName) VALUES ('Fred', 'Green')
>
> the data then becomes
>
> Empno firstName lastName
> ----------------------------------
> 1 Bob Smith
> 2 Fred Green
>
> could anyone help me on duplicating a similar increment on oracle?
>
> also...
>
> CREATE TABLE Client
> (ClientID int IDENTITY primary key clustered,
> firstName varchar(64) NOT NULL,
> lastName VarChar(64) NOT NULL,
> nameID int NOT NULL)
>
> could someone tell me what the clustered keyword is and how to
> duplicate its effects on oracle or whether they are automatically done
> for primary keys within oracle.
>
> if you could help me with any of this i would be incredibly gratefull
>
> -=-=-
> ILUZN
> -=-=-
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
Received on Tue Jan 16 2001 - 03:57:29 CST