Difference between revisions of "SQL DELETE"

From Recital Documentation Wiki
Jump to: navigation, search
(Syntax)
Line 6: Line 6:
 
DELETE FROM [<database>!]&#060;table&#062;
 
DELETE FROM [<database>!]&#060;table&#062;
 
   
 
   
[WHERE CURRENT OF <cursor> | [CURRENT OF] <condition>]
+
[WHERE CURRENT OF <cursor> | <condition>]
 
+
  
 
==See Also==
 
==See Also==

Revision as of 01:16, 8 December 2009

Purpose

Deletes one or more rows from a table


Syntax

DELETE FROM [<database>!]<table>

[WHERE CURRENT OF <cursor> | <condition>]

See Also

ADD TABLE, CREATE DATABASE, DB_DATADIR, EXECUTE IMMEDIATE, INSERT, GETENV(), OPEN DATABASE, SET AUTOCATALOG, SET TCACHE, USE


Description

The DELETE command executes an immediate physical deletion of the specified records i.e., records are permanently removed from the table, and cannot be recalled.

To perform a DELETE operation you must have the DELETE privilege or be the owner of the table.


Keywords Description
database The name of the database to which the table belongs. Databases in Recital are implemented as directories containing files that correspond to the tables and associated files in the database. Operating System file protection can be applied individually to the files for added security. The directory is a sub-directory of the Recital data directory. The environment variable / symbol DB_DATADIR points to the current Recital data directory and can be queried using the GETENV() function. Files from other directories can be added to the database using the ADD TABLE command or via the database catalog and SET AUTOCATALOG functionality. The '!' character must be included between the database name and the table name.
table The name of the table from which to delete the rows.
WHERE Specifies which rows are to be deleted.
CURRENT OF cursor Deletes only the row most recently fetched by the cursor.
condition Deletes only the rows that satisfy the condition.


Example

DELETE FROM staff 
WHERE ord_date < date();


Products

Recital Server, Recital