Load/Truncate behaviour in DB2

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Load/Truncate behaviour in DB2

Post by arvind_ds »

I have created a parallel job which loads data from a sequential file to a DB2 table. My Question is regarding "Write method = Truncate" option in target DB2 enterprise stage.

When we use "Write method = Load" and "Write mode = truncate", what happens to the table in DB2 database. Does it execute delete command or does it use truncate command to empty the table before loading new data.

Note : I am using DB2 version 9.1.0.3 and DataStage version is 7.5.2

Thanks
Arvind
stefanfrost1
Premium Member
Premium Member
Posts: 99
Joined: Mon Sep 03, 2007 7:49 am
Location: Stockholm, Sweden

Post by stefanfrost1 »

As far as I know there isn't a truncate statement in db2 as in for example Oracle. However there is a alter table statement that preforms the same function that you are searching for. I doubt that db2ee-stage is using that technique, i would guess that it actually preforms a "real" deletestatement.

There are some enviroment varibles that can be turned on in datastage. Don't remember them exactly but you can search for db2 variabels in the documentation or on this site. APT_DB2_DEBUG or something, there are a few, and they write any db2 statement executed from datastage to db2 for any process doing so. This will help you understand the process of the db2ee-stage.
-------------------------------------
http://it.toolbox.com/blogs/bi-aj
my blog on delivering business intelligence using agile principles
Post Reply