Delete Statement
The Delete statement is used to delete rows from a database table. The form of the Delete statement supported for flat-file drivers is:
table_namecan be a simple table name or a full path name. A table name is preferred for portability to other SQL data sources.The Where clause determines which rows are to be deleted. If you include only the keyword Where, all rows in the table are deleted, but the file is left intact.
The Where Current Of
cursor_nameclause can be used only by developers coding directly to the ODBC API. It causes the row at whichcursor_nameis positioned to be deleted. This is called a "positioned delete." You must first execute a Select...For Update statement with a named cursor and fetch the row to be deleted.An example of a Delete statement on the emp table is:
Each Delete statement removes every record that meets the conditions in the Where clause. In this case, every record having the employee ID E10001 is deleted. Because employee IDs are unique in the employee table, at most, one record is deleted.