Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Format

Examples

RDB/VMS Relational Database Operator ERASE — VMS RDB_3.1A

 Erases records from a relation.  Before using the ERASE statement,
 you must start a read/write transaction and establish a record stream
 using a context variable with a FOR statement or a START_STREAM
 statement.  You cannot erase records from a view that was formed with
 a WITH, REDUCED, or CROSS clause of an RDO record selection
 expression.  Also, you cannot erase records from a view that was
 formed with a UNION clause of an SQL select expression.

 Example:

     RDO> START_TRANSACTION READ_WRITE RESERVING
     cont>  COLLEGES FOR EXCLUSIVE WRITE
     RDO>     FOR C IN COLLEGES
     cont>      ERASE C
     cont>    END_FOR
     RDO> COMMIT

Additional information available:

FormatExamples

Format

 ERASE ─> context-var ─┬───────>─────┬─>
                       └─> on-error ─┘

             3 context-var A temporary name specified in an RSE for
              name recognition.  You must define the context variable
              in a START_STREAM statement or in a FOR loop.  Request
              HELP on RSE for more information.

             3 on-error The ON ERROR clause, which specifies a host
              language statement or Rdb/VMS data manipulation
              statement to be performed if an Rdb/VMS error occurs.
              Request HELP on ON_ERROR for more information.

Examples

 Example 1

 Assume you wish to erase all the records in the COLLEGES relation:

 RDO> START_TRANSACTION READ_WRITE RESERVING
 cont>  COLLEGES FOR EXCLUSIVE WRITE
 RDO> FOR C IN COLLEGES ERASE C END-FOR
 RDO> PRINT COUNT OF C IN COLLEGES
  0
 RDO> COMMIT

 This statement uses the loop established by the FOR statement and
 erases all the records from the COLLEGES relation.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026