Previous Topic: Example 3Next Topic: Example 5


Example 4

Create a table with the same specifications as Example 2, but specify that the DEPTNO and MGRNBR columns are to have a combined value which is unique for this table.

Note: The last column definition is separated from the table-level UNIQUE constraint by a comma.

EXEC SQL
      CREATE TABLE TED.DEPTTBL
           (DEPTNO CHAR(2) NOT NULL UNIQUE,
            DEPTNAME CHAR(24),
            MGRNBR CHAR(6),
            ADMDEPT CHAR(2),
            UNIQUE (DEPTNO, MGRNBR))
END-EXEC