HPlogo ALLBASE/SQL Database Administration Guide: HP 3000 MPE/iX Computer Systems > Chapter 8  System Catalog

System.Constraint

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

SYSTEM.CONSTRAINT contains detailed information about the integrity constraints contained in the database.

Initially, the table is empty. ALLBASE/SQL updates this table when processing a CREATE TABLE, ALTER TABLE, CREATE VIEW, DROP TABLE, DROP VIEW, or TRANSFER OWNERSHIP statement involving an integrity constraint.

This table is accessed whenever an INSERT, format II INSERT, UDPATE, or DELETE is performed on a table to determine if any integrity constraints need to be enforced. Further checking into SYSTEM.CONSTRAINTCOL is made if a table is found in SYSTEM.CONSTRAINT, to enforce referential constraints (UNIQUE, PRIMARY KEY, FOREIGN KEY) on a column-dependent basis.

Table 8-8 System.Constraint

Column NameTypeLengthDescription
CONSTRAINTNAMECHAR20Name of the constraint
OWNERCHAR20Owner of the table or view
TABLENAMECHAR20Name of the table or view
TYPECHAR2

Type of constraint:

C

table check constraint

P

primary key

R

referential constraint (foreign key)

U

unique constraint (key other than primary)

V

view check constraint

INDEXTYPECHAR2

Type of index used:

C

clustered index

H

hash structure

N

none specified

NUMCINTEGER4Number of columns in the constraint if TYPE is one of P, R, or U.
REFOWNERCHAR20Owner of the key column referenced in a FOREIGN KEY constraint
REFCONSTRAINTCHAR20Constraint Name of the key column referenced in a FOREIGN KEY constraint
DBEFILESETCHAR20Name of the DBEFileSet containing the stored section for a table check constraint (blank if not applicable)

 

Example



   SELECT * FROM System.Constraint;

   --------------------+--------------------+--------------------+----+---------

   CONSTRAINTNAME      |OWNER               |TABLENAME           |TYPE|INDEXTYPE

   --------------------+--------------------+--------------------+----+---------

   SQLCON_00000001P00  |PURCHDB             |PARTS1              |P   |N

   CLUBS_PK            |RECDB               |CLUBS               |P   |N

   MEMBERS_PK          |RECDB               |MEMBERS             |P   |N

   MEMBERS_FK          |RECDB               |MEMBERS             |R   |N

   EVENTS_FK           |RECDB               |EVENTS              |R   |N

   ---------------------------------------------------------------------------

   Number of rows selected is 5

   U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd]> r

  

   +-----------+--------------------+--------------------+--------------------

   |NUMC       |REFOWNER            |REFCONSTRAINT       |DBEFILESET

   +-----------+--------------------+--------------------+--------------------

   |          1|                    |                    |

   |          1|                    |                    |

   |          2|                    |                    |

   |          1|RECDB               |CLUBS_PK            |

   |          2|RECDB               |MEMBERS_PK          |

   ---------------------------------------------------------------------------

   Number of rows selected is 5

   U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd]> r


Feedback to webmaster