SQL Language (MOSC)

MOSC Banner

for primary key:sequence or select id and add 1

edited Apr 2, 2015 5:07AM in SQL Language (MOSC) 1 commentAnswered ✓

in any table i have a primary key , to generate a value in primary key we have options

1- create sequence and assign the sequence to the column.

2- select max(id)+1  and assign the value to the column .

what is the best ?

what is the disadvantages for option 2 ?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center