Update query



IBM's flagship relational database management system

Update query

Postby hvats83 » Fri Dec 21, 2012 1:44 pm

In a COBOL\DB2 program if I am updating a column value (which is part of index) which option is better-
First delete the record which ging to be updated and then insert new record with updated values
or
directly using update query
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Update query

Postby GuyC » Fri Dec 21, 2012 3:02 pm

update would only relocate (delete/insert) in that one indexspace.
Think about what an actual delete/insert would do concerning entry in the tablespace and other indexpaces, what if this row has children?
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Update query

Postby hvats83 » Fri Dec 21, 2012 3:20 pm

The table being updated in program is not having child tables
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post