Skip to Main Content

Oracle Database Discussions

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to swap values without getting dup_val_on_index exception

kdwolfMay 22 2011 — edited May 23 2011
My table has a primary key with the follow segments:
TV Channel Id
Schedule Date
Version Number.

Each TV Channel may have more than one planned schedule for a given schedule date.
Normally Version Number = 0 would be the one to be aired, but occasionally other versions may be aired instead.

A user may decide to swap between the versions, e.g. if for Channel Id = 1 and Schedule Date = 05/05/2011
there are two Version Numbers - 0 and 1, a user may decide to swap between them, so version 1 will now version 0 and version 0 - version 1.

What is the best way to perform such a change without causing the exception? Normally there could be up to 5 different versions for a same
channel / date combination, so it is not just to swap 0 with 1.

Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 20 2011
Added on May 22 2011
3 comments
208 views