Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between alter table statements to add primary keys

user629987Apr 30 2009 — edited Apr 30 2009
Hi,

Can someone explain what the difference between these 2 statements are and if & when one should be used over the other?
Also, are the brackets around the column name necessary?
Thanks!


ALTER TABLE xyz ADD CONSTRAINT id_pk PRIMARY KEY (id);

ALTER TABLE xyz ADD PRIMARY KEY (id);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2009
Added on Apr 30 2009
7 comments
544 views