Page 1 of 1

DB2 z/os V9 Update unique index

PostPosted: Thu Sep 27, 2012 9:09 pm
by p19689
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.

Re: DB2 z/os V9 Update unique index

PostPosted: Thu Sep 27, 2012 11:44 pm
by dick scherrer
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.

Re: DB2 z/os V9 Update unique index

PostPosted: Fri Sep 28, 2012 2:40 am
by p19689
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 ?

Re: DB2 z/os V9 Update unique index

PostPosted: Fri Sep 28, 2012 1:01 pm
by GuyC
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