Scalable Database Server, HiRDB Version 8 Description

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

5.2.4 Data deletion

Data deletion is the process of removing either the rows from a table that satisfy conditions that are specified with respect to a column or all rows that constitute the table. The data deletion methods and an example of specifying SQL statements are shown as follows.

Data deletion methods
The DELETE or PURGE TABLE statement is used to delete data. The following three methods are available for deleting data:
  • Deleting the row being pointed to by the cursor
  • Deleting only those rows that satisfy a condition (specify the WHERE clause in the DELETE statement)
  • Deleting all rows (PURGE TABLE statement)

Data deletion SQL specification example
An example of deleting only those rows that satisfy a condition is explained as follows.
Example
In this example, the DELETE statement deletes from the stock table (STOCK) only the data whose product name (PNAME) is skirt:
 
DELETE FROM STOCK
  WHERE PNAME='skirt'