skip to main content

Embedded SQL Statements : DELETE

DELETE
The DELETE statement removes rows from a database table.
General format
EXEC SQL [AT Database]
  DELETE Options [ WHERE {Search-Condition       } ]
Syntax rules
1.
2.
Search-Condition is composed of predicates of various kinds, optionally combined using parentheses and logical operators. Its syntax is database dependent, therefore only Host Variables are handled and no further syntax checking is performed. Syntax errors, if any, are returned at runtime.
3.
General rules
1.
When Search-Condition is specified, only rows matching it are deleted.
2.
When Search-Condition is not specified, all rows are deleted.
3.
Database identifies the active connection that will execute the query and must be previously defined using a Format 4 DECLARE statement.
Examples
Delete 2 records by specific key
exec sql
   delete from customers where  cust-code = 2 or cust-code = 4

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left