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!

Alter table with different default values

513949Aug 30 2007 — edited Aug 30 2007

Hi,

I'm trying to add a primary key to an existing (and bad designed) table.

My first approach was create a sequence and use the sequence nextval as default.

ALTER TABLE MyTable
     ADD MyTable_ID NUMBER(22) DEFAULT Mysequence.NEXTVAL;

But, it is not allowed in Oracle 9.2

Any suggestion?

Xks,
Miguel

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 27 2007
Added on Aug 30 2007
10 comments
4,464 views