DELETE (Searched)

Removes table rows that meet the search criteria.


>>--EXEC SQL--.-------------------.---DELETE--.------.--->
              +-FOR :host_integer-+           +-FROM-+

    +--view_name-+  +-WHERE search_conditions-+


host_integer A host variable that specifies the maximum number of host array elements processed. Must be declared as PIC S9(4) COMP-5 or PIC S9(9) COMP-5.
FROM An optional keyword. It is required for ANSI SQL 92 conformance.
table_name The target table for the delete operation.
view_name The target view for the delete operation.
WHERE A standard SQL WHERE clause identifying the row to be deleted.
search_conditions Any valid expression that can follow the standard SQL WHERE clause.


DELETE is a standard SQL statement. See the documentation supplied with your ODBC driver for the exact syntax.

You cannot mix simple host variables with host arrays in the WHERE clause. If one of the host variables is an array, they must all be arrays.

If you do not specify a WHERE clause, all of the rows in the named table are removed.


   DELETE FROM staff WHERE staff_id = 99