Delete all rows of a table
The DELETE statement specifies a table and usually contains
a WHERE clause that designates the row or rows that are to be removed
from the table. If the WHERE clause is left out, all rows are deleted.
Important: Do not execute the following statement.
DELETE FROM customer;
You
can write DELETE statements with or without the FROM keyword.
DELETE customer;
Because these DELETE statements do not contain a WHERE clause, all rows from the customer table are deleted. If you attempt an unconditional delete using the DB-Access menu options, the program warns you and asks for confirmation. However, an unconditional DELETE from within a program can occur without warning.
If
you want to delete rows from a table named from, you must first
set the DELIMIDENT environment variable, or qualify
the name of the table with the name of its owner:
DELETE legree.from;
For more information about delimited identifiers and DELIMIDENT environment variable, see the descriptions of the Quoted String expression and of the Identifier segment in the HCL OneDB™ Guide to SQL: Syntax.