2012-10-30

how to have identity from sql server in oracle

http://nuijten.blogspot.ro/2012/10/oow-2012-little-things-make-me-happy.html

x int default s.nextval primary key
where s is a sequence


In sqlserver you would have

The following SQL statement defines the "P_Id" column to be an auto-increment primary key field in the "Persons" table:
CREATE TABLE Persons
(
P_Id int PRIMARY KEY IDENTITY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)

Niciun comentariu:

Trimiteți un comentariu