ODBC Server Reference Manual
CORE SQL Language
HP NonStop ODBC Server Reference Manual—429151-002
3-46
Searched DELETE
DELETE deletes the corresponding row of the base table from which the viewed
table is derived.
The table-name must be the (single) table referenced by the FROM clause of the
query-specification that defines the result table of the cursor.
If the specified table is audited, the positioned DELETE statement cannot be used
unless a user transaction is in progress (the SQL_AUTOCOMMIT option of the
ODBC function SQLSetConnectOption must be off).
cursor-name
specifies the cursor for which the active row is to be deleted. The cursor
specification for cursor-name must include the FOR UPDATE clause, and the
result table of the cursor must be updatable.
The search-condition cannot contain subqueries that refer to the table or view
from which the rows are being deleted.
If you omit the WHERE clause, all rows are deleted.
Searched DELETE
The searched DELETE statement has the following syntax:
table-name
is the table from which rows are to be deleted. The table-name can be qualified
with the database name and owner name. If table-name is a viewed table,
DELETE deletes the corresponding row of the base table from which the viewed
table is derived.
The table-name must be updatable and must not be referenced, directly or
indirectly, by a FROM clause of any subquery contained in search-condition.
search-condition
specifies the criteria for the rows to delete. DELETE deletes every row that
satisfies search-condition. If no row satisfies search-condition, DELETE
does not delete any rows.
If you omit the WHERE clause, DELETE deletes all rows in the table.
DELETE FROM table-name
[ WHERE search-condition ]