Db2 Truncate Example

View All Questions

Ask a New Question

  Posted by Guest - Db2 Truncate Example :
I'm looking for an example on using db2 z/os with the truncate command to empty a table.  Also couldn't I just do a load job with a dummy input file to wipe it out?

Guest Says:
Yes you can do a dummy load job, but you can do that from sql, it would have to be a separate job.  The truncate command can run from a program, spufi, etc.

truncate table abc.table1   (You don't need any other parameters other then that)

Guest Says:
Why not just delete from the table, it seems like the same sql results

Guest Says:
Well truncate really is a delete without a where clause, so yeah you are right.  However if you have triggers or anything on the table you can bypass those using truncate, where you cannot bypass triggers using the delete statement for example.  


Add your reply below ...



This site allows you to ask questions and get answers from various posters. You may also answer any posts if you feel like you have input to give. Feel free to ask for help with any new question you wish, but most of the questions here are tech related. You will find many questions and answers related to your Ipod or Ipod Nano, Itunes, audio and video converting, spyware or adware cleanup, pc or other computer questions, and even mainframe questions. Although these are the tech questions most often asked, you will find help on almost any computer or software related subject. Feel free to go to the main menu and review the posts already present, or feel free to ask your own question. (Some questions will be closed once the moderator feels they are sufficiently answered and that no other input is needed).

See All Tips        Iphone Apps


Your Name:

Your Reply:

Type in verification code:


Forum - Front Page

Spyware/Task Database

Computer Tips (Main Page)