Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multiple delete from a Table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
vasudevan_c

New User


Joined: 15 Apr 2008
Posts: 7
Location: bangalore

PostPosted: Tue Dec 01, 2009 11:41 am    Post subject: Multiple delete from a Table
Reply with quote

Hi All,
Can anyone tell me how does multiple rows can be performed in an application program. PFB the requirement

Its a table, which will receive daily insert and delete files. The primary key is field called Trace id. I will get this Trace id in my input file to delete the record from the table. The delete volume that i may get is around 10 million. But problem is another similar table, for deleting 600K rec took 38 mins, so going by this for deleting 1000K rec it wl take hours to complete. As this table is expose to online as well...i can not go ahead with single row delete. So please suggest me any approach so that i can delete multiple row together, with better performance.

Thanks,
Vasu
Back to top
View user's profile Send private message

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Dec 01, 2009 12:19 pm    Post subject:
Reply with quote

Define PFB. DB2 tables have rows, not records. For that many deletes, I'd unload the table, delete the appropriate records from the unloaded file, then reload the table.
Back to top
View user's profile Send private message
vasudevan_c

New User


Joined: 15 Apr 2008
Posts: 7
Location: bangalore

PostPosted: Tue Dec 01, 2009 12:29 pm    Post subject: Multiple delete from a Table
Reply with quote

Thanks a lot Terry.

But tell me one thing, is it advisable to use load utility daily for an table?



Thanks,
Vasu
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Tue Dec 01, 2009 5:36 pm    Post subject:
Reply with quote

Vasudevan,

Quote:
But tell me one thing, is it advisable to use load utility daily for an table?


We do it, in our everyday batch cycle, for a lot of tables. So, what's the problem in that.


Sushanth
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Dec 01, 2009 7:17 pm    Post subject:
Reply with quote

Use DISCARD REORG with the proper conditions. It much faster than normal delete. But you need to provide where clause for delete which in your case keeps on changing as per the input file.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us