Michael wrote:
Hi,
Is there a way to run the following sql quickly in DB2?
DELETE FROM tablename;
Also, is there an DB2 sql similar to Oralce TRUNCATE TABLE?
thanks in advance,
Michael
There are multiple ways you can do that:
1.
ALTER TABLE T ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
COMMIT;
2. Load replace with empty table:
DECLARE cur CURSOR FOR SELECT * FROM S.T WHERE 1=0
LOAD FROM cur OF CURSOR REPLACE INTO S.T
3. IMPORT from an empty file with REPLACE
Cheers
Serge