Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> equivalent of identity(MS-SQL2000) in oracle

equivalent of identity(MS-SQL2000) in oracle

From: <iluzn_at_my-deja.com>
Date: Tue, 16 Jan 2001 01:10:37 GMT
Message-ID: <940727$gmp$1@nnrp1.deja.com>

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/ Received on Mon Jan 15 2001 - 19:10:37 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US