pramod wrote:
Hi
I know we can truncate a table in DB2 by first creating it with NOT
LOGGED INITIALLY option.
It is not necessary any longer to specify the NLI option at create table
time.
and when we need to truncate it, run the
following command
alter table <table name> activate not logged initially with empty table
My question is:
1. Do we have to connect to the database with auto-commit off every
time we have to run this.
If yes, then why?
No, you don't. The ALTER TABLE will truncate the table. If this is all you
want to do, you can commit right away or let auto-commit do this for you.
But if you want to do other things on the table that are not logged, you
have to do this in the same transaction as the ALTER TABLE and /then/ you
need to ensure that no implicit commit is run, i.e. turn auto-commit off.
--
Knut Stolze
DB2 Information Integration Development
IBM Germany