DELETE FROM statement

The DELETE FROM statement deletes rows from a table in an external database, based on a search condition.

SYNTAX

A correlation name is created that you can use inside the search condition to refer to the values of columns in the table. This correlation name is either the name of the table (without the data source qualifier) or the explicit qualifier specified.

Handling errors

For further information about handling database errors, see Capturing database state.

Start of change

Examples

The following example assumes that the dataSource property has been configured and that the database it identifies has a table called SHAREHOLDINGS, with a column called ACCOUNTNO.
DELETE FROM Database.SHAREHOLDINGS AS S
       WHERE S.ACCOUNTNO = InputBody.AccountNumber;

This removes all the rows from the SHAREHOLDINGS table where the value in the ACCOUNTNO column (in the table) is equal to that in the AccountNumber field in the message. This may delete zero, one, or more rows from the table.

End of change
Related concepts
ESQL overview
Related tasks
Developing ESQL
Related reference
Syntax diagrams: available types
ESQL statements