If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Question about Delete some rows from large table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #16 (permalink)  
Old 02-14-03, 11:09
David2002 David2002 is offline
Registered User
 
Join Date: Jul 2002
Posts: 86
Quote:
Originally posted by chris72
If you want, you can use QMF for generating the needed delete statement in the way decripted in the last post.
You select the keys and make punctual delete statements. It avoids lock.
Remember to use commit after every delete statement!!!!!!!!!
In this way if something goes wrong rollback takes just few second (to rollback the last update!).
Is it enough clear?
Thank you all (chris72,dahalkar_p,enherber,grofaty,dollar489,... ) for spending your time in this problem.

Chris could you please explain more (we do not have MQF) do you mean I declare cursor and use "with current cursor <corsur_name> in delete command, if not give me a small sample.
Thanks again
Reply With Quote
  #17 (permalink)  
Old 02-17-03, 02:31
chris72 chris72 is offline
Registered User
 
Join Date: Feb 2003
Posts: 22
In short...you have to extract via select list all your delete statement.
Like this:
SELECT 'DELETE FROM TAB WHERE KEY_TAB=' !!KEY_TAB!!';commit;'
FROM TAB
WHERE search-condition. In this way you build all your delete statement, but these statement are row per row (I have assumed that key is the unique key!).

Of course if you have to put a more complex delete you need more than one row to write it. That is because i've mentioned QMF ....
__________________
Cristiana
Data Base Administrator
Bologna
Italy
Reply With Quote
  #18 (permalink)  
Old 02-17-03, 12:44
David2002 David2002 is offline
Registered User
 
Join Date: Jul 2002
Posts: 86
Quote:
Originally posted by chris72
In short...you have to extract via select list all your delete statement.
Like this:
SELECT 'DELETE FROM TAB WHERE KEY_TAB=' !!KEY_TAB!!';commit;'
FROM TAB
WHERE search-condition. In this way you build all your delete statement, but these statement are row per row (I have assumed that key is the unique key!).

Of course if you have to put a more complex delete you need more than one row to write it. That is because i've mentioned QMF ....
Thank you so much chris.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On