Difference between revisions of "SQL DELETE"

From Recital Documentation Wiki
Jump to: navigation, search
(Description)
 
(4 intermediate revisions by one user not shown)
Line 9: Line 9:
  
 
==See Also==
 
==See Also==
[[ADD TABLE]], [[CREATE DATABASE]], [[DB_DATADIR]], [[EXECUTE IMMEDIATE]], [[SQL INSERT|INSERT]], [[GETENV()]], [[OPEN DATABASE]], [[SET AUTOCATALOG]], [[SET TCACHE]], [[SQL USE|USE]]
+
[[ADD TABLE]], [[SQL CLOSE|CLOSE]], [[CREATE DATABASE]], [[DB_DATADIR]], [[DECLARE CURSOR]], [[DROP CURSOR]], [[EXECUTE IMMEDIATE]], [[FETCH]], [[GETENV()]], [[SQL INSERT|INSERT]], [[OPEN]], [[OPEN DATABASE]], [[SET AUTOCATALOG]], [[SQL UPDATE|UPDATE]], [[SQL USE|USE]]
  
  
 
==Description==
 
==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.
+
For third-party gateway databases, 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.  For native tables, it works in the same way as the Recital [[DELETE]] command, marking the record(s) for deletion.
  
 
To perform a DELETE operation you must have the DELETE privilege or be the owner of the table.
 
To perform a DELETE operation you must have the DELETE privilege or be the owner of the table.
Line 21: Line 21:
 
!Keywords||Description
 
!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.
+
|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 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.
 
|table||The name of the table from which to delete the rows.
Line 32: Line 32:
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==

Latest revision as of 15:25, 15 March 2012

Purpose

Deletes one or more rows from a table


Syntax

DELETE FROM [<database>!]<table>

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

See Also

ADD TABLE, CLOSE, CREATE DATABASE, DB_DATADIR, DECLARE CURSOR, DROP CURSOR, EXECUTE IMMEDIATE, FETCH, GETENV(), INSERT, OPEN, OPEN DATABASE, SET AUTOCATALOG, UPDATE, USE


Description

For third-party gateway databases, 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. For native tables, it works in the same way as the Recital DELETE command, marking the record(s) for deletion.

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 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