Kbase P5574: SQL92 and table constraint
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Verified
GOAL:
SQL-92 and table constraints
GOAL:
Sample of table constraints in SQL-92
FIX:
The table constraints must not:
o Refer to any column other than columns that precede it in the table definition
o Contain aggregate functions, subqueries, or parameter references
Find a valid sample below.
CREATE TABLE sample(
CUS_708_COMP number(02,00) not null,
SUB_CAT3_OID number(10,00),
SUB_CAT3_KEY number(18,00),
CONSTRAINT ICS_SUB_CAT3_OPT
CHECK( ( SUB_CAT3_OID IS NULL AND
SUB_CAT3_KEY IS NULL)
OR
( SUB_CAT3_OID IS NOT NULL AND
CUS_708_COMP IS NOT NULL )
)
);