DELETE dbtab

Short Reference

Syntax

DELETE { {FROM target [WHERE sql_cond]}
       | {target FROM source} }.

Effect

The statement DELETE deletes one or more rows from the database table specified in target. The rows that are to be deleted are specified either in a WHERE condition sql_cond or with data objects in source.

System Fields

The statement DELETE sets the values of the system fields sy-subrc and sy-dbcnt.

sy-subrc Meaning
0 A least one row was deleted.
4 At least one row could not be deleted, since it was not found in the database table.

The statement DELETE sets sy-dbcnt to the number of deleted rows.

Note

The rows are deleted permanently from the database table in the next database commit. Until then, you can cancel the deletion using a database rollback. The statement DELETE sets a database lock until the next database commit or database rollback. If used incorrectly, this can lead to a deadlock.

The number of rows that can be deleted within a database LUW in the tables of a database has a specific restriction for each database, as each database system can only manage a limited amount of data in the rollback area, and a limited number of locks.