Nonstop Database, HiRDB Version 9 System Operation Guide

[Contents][Index][Back][Next]

13.5 Deleting data from a table

Executor: Table owner or DELETE privilege holder

The DELETE or the PURGE TABLE statement is used to delete an unneeded row from a table.

Hint
  • When a row is deleted from a view table, the corresponding row is deleted from its base table.
  • For falsification prevented tables, only rows whose deletion prevented duration has elapsed can be deleted.
Organization of this section
(1) Deleting a selected row
(2) Deleting all rows

(1) Deleting a selected row

To delete a selected row, the WHERE clause must be specified in the DELETE statement.

(2) Deleting all rows

To delete all rows from a table, the following SQL must be executed:

Points to be considered
  • When all rows are to be deleted from a table that contains many rows, the PURGE TABLE statement deletes rows faster than the DELETE statement.
  • When many rows are to be deleted with the DELETE statement, the lock mode should be set by first executing the LOCK statement with EXCLUSIVE specified in order to reduce the overhead for exclusive control.
  • Deleting many rows with the DELETE statement has no effect on the free space in the user RDAREAs, because the segments remain allocated. To create free space, the PURGE TABLE statement must be used.