Page 1 of 1

Load/Truncate behaviour in DB2

Posted: Fri Oct 17, 2008 4:04 am
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

Posted: Fri Oct 17, 2008 4:34 am
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.