DB2 z/os V9 Update unique index



IBM's flagship relational database management system

DB2 z/os V9 Update unique index

Postby p19689 » Thu Sep 27, 2012 9:09 pm

Hi , Is it possible to update a column in a composite Unique index on Db2 Table ? There is only one index on the Table. When I Check the column from catalog manager and Interprete (option I) , it says - Update allowed NO. Please shade some light on this and thanks in advance.
p19689
 
Posts: 65
Joined: Fri Oct 01, 2010 1:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DB2 z/os V9 Update unique index

 

Re: DB2 z/os V9 Update unique index

Postby dick scherrer » Thu Sep 27, 2012 11:44 pm

Hello,

What light might we shine? If "Update allowed NO", you may not update this.

Delete the row and re-insert with the changed value(s). Depending on your specifics, it may be a simple delete/insert or it may take additional consideration.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: DB2 z/os V9 Update unique index

Postby p19689 » Fri Sep 28, 2012 2:40 am

Thanks for your reply. What I'm trying to understand is why a column in an unique index is not allowed to update even if the uniqueness is not vialated . Please anybody can explain why ?
p19689
 
Posts: 65
Joined: Fri Oct 01, 2010 1:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DB2 z/os V9 Update unique index

Postby GuyC » Fri Sep 28, 2012 1:01 pm

I don't know catalog manager, but - within DB2 - there is no reason a column from unique indexes can't be updated. I do it all the time.
Reasons for a column not to be updatable are
- GENERATED ALWAYS
- Read-only View
I can explain it to you, but i can not understand it for you.
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post