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!

fix sequencenumber

ANNECMay 30 2019 — edited May 31 2019

We are using Oracle 12c,

I have a vendor product database which has two columns dcid, and id in a table, they both are sequence numbers. But they are two different sequences.

I made a mistake when I do a SQL insert. I used the same sequence  to populate the two different columns.

insert into my table (dcid, id)

values (mytable_dcid_Sq.nextVal,    Mytable_dcid_sq.nextVal)

what I should do is:

insert into my table (dcid, id)

values (mytable_dcid_Sq.nextVal,    Mytable_id_sq.nextVal)

Now I would like to fix it. I want to do an update using the value of dcid column to update id column.

Is there going to be an issue?

The data dictionary like user_sequences will still shows correct last_number?

Thanks

This post has been answered by CarlosDLG on May 31 2019
Jump to Answer
Comments
Post Details
Added on May 30 2019
13 comments
529 views