RDB/VMS Relational Database Operator DELETE_CONSTRAINT — VMS RDB_4.0B
Deletes one or more constraint definitions. When the DELETE
CONSTRAINT statement executes, Rdb/VMS deletes the constraint
definition from the physical database. If you use the PATHNAME
qualifier when you invoke the database, DELETE CONSTRAINT also
deletes the constraint definition from the data dictionary.
You cannot delete a constraint when there are active transactions
that access the relation or relations involved.
You must execute this statement in a read/write transaction. If
there is no active transaction and you issue this statement, Rdb/VMS
starts a read/write transaction implicitly.
You cannot delete a constraint definition unless you have invoked the
database that includes the constraint. Other users are allowed to be
attached to the database when you issue the DELETE CONSTRAINT
statement.
Example:
DELETE CONSTRAINT EMPLOYEE_ID_EXISTS.
Additional information available:
Format
DELETE CONSTRAINT ──┬──> constraint-name ──┬──> . └─────<─── , ────<─────┘
Additional information available:
constraint-name
The name of the constraint definition you want to delete.
Examples
Example 1 The following example deletes a single constraint definition: INVOKE DATABASE PATHNAME 'PERSONNEL' DELETE CONSTRAINT EMP_NUM_CON. This statement deletes EMP_NUM_CON from the physical database and the data dictionary. Example 2 You can also delete more than one constraint definition at once: INVOKE DATABASE FILENAME 'PERSONNEL' DELETE CONSTRAINT SAL_CON,SS_NUM_CON. This statement deletes the two constraint definitions from the physical database.
More
To delete a constraint, you must have the Rdb/VMS READ privilege to the database and the Rdb/VMS DELETE privilege to all relations to which the constraint refers.