|
|
DELETE
Deletes a set of rows from a table or view.
Usage
Embedded/Interactive/ODBC/Procedural/JDBC.
Description
All rows in the set defined by the
WHEREclause are deleted from the base table or view identified bytable-name. If noWHEREclause is specified, all rows are deleted.If
table-nameidentifies a view rather than a base table, entire rows, including columns invisible from the view, are deleted from the base table on which the view is defined. For a delete to be performed on a view, the view must be updatable, see CREATE VIEW.A
NOT FOUNDcondition code is returned if no row is deleted, see Return Status and Conditions.Language Elements
search-condition, see Search Conditions.Restrictions
DELETEprivilege must be held on the table or view identified bytable-name.In a procedural usage context, the
DELETEstatement is only permitted if the procedureaccess-clauseisMODIFIES SQL DATA, see CREATE PROCEDURE.Notes
If a
correlation-nameis specified after the table name in theDELETE FROMclause, the correlation name must be used to refer to the table in theWHEREclause of theDELETEstatement.If the table name addressed by the
DELETEstatement is subject to any referential constraints, the delete operation must not create a situation where these constraints are violated. The effect of the delete operation on any referential constraints depends on thedelete-rulein effect for each constraint, see CREATE TABLE for a description of thedelete-ruleoptions.A
DELETEstatement is executed as a single statement. If an error occurs at any point during the execution, none of the rows in the set defined by theWHEREclause will be deleted (however, if the table is stored in a databank with theWORKoption it is possible that some rows will be deleted).Example
DELETE FROM countries WHERE CITY = 'Dublin';Standard Compliance
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|