Observation: DELETE Statement

You coded a DELETE statement. Depending on the volume of rows that will deleted, using a DELETE statement may not be the quickest or the most efficient means to effect the changes.

For HIGH VOLUME DELETEs, consider the following alternative:

  • Unload the table using the UNLOAD option of the Db2 REORG utility.

  • Reload only those rows which are to be saved, using the Db2 LOAD utility, while specifying LOG NO.

In the example below, the LOAD utility control statement WHEN parameter is used to indicate that only those input source records that begin with the value XYZ are to be reloaded:

LOAD DATA 
LOG NO 
INDDN INDD 
INTO TABLE DSN8410.EMP 
WHEN (1:3) = 'XYZ'