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: 1239
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm


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