DELETE (SEARCHED)

Embedded SQL for C and SQL Server

Embedded SQL for C and SQL Server

DELETE (SEARCHED)

The DELETE (SEARCHED) statement removes table rows that meet the search criteria. DELETE is a standard Transact-SQL statement.

Syntax

DELETE [FROM] {table_name | view_name} [WHERE search_conditions]

Arguments

FROM

Is an optional keyword included for compatibility with other versions of ESQL/C.

table_name

Is the table to remove rows from.

view_name

Is the view to remove rows from.

search_conditions

Is any expression that can legally follow the standard Transact-SQL WHERE clause.

Remarks

If you do not use a WHERE clause, all rows in the table specified in the DELETE statement are removed. The table, although it no longer contains data, exists until you use a DROP TABLE statement.

You cannot use DELETE on a view with a FROM clause that specifies more than one table. This would change several tables and is not supported. However, UPDATE and INSERT statements that affect only one base table of the view are supported.

Examples
EXEC SQL DELETE FROM authors WHERE au_lname = 'White'