Previous Topic: Example 1Next Topic: Example 3


Example 2

Create a table with the following specifications:

  1. Authorization ID: TED

    In this example, TED is not the default authorization ID. It is therefore necessary to specify the authorization ID.

  2. Table name: DEPTTBL
  3. Column names: DEPTNO (value to be unique), DEPTNAME, MGRNBR, ADMDEPT
  4. Data type: CHAR for all columns
    EXEC SQL
          CREATE TABLE TED.DEPTTBL
               (DEPTNO CHAR(2) NOT NULL UNIQUE,
                DEPTNAME CHAR(24),
                MGRNBR CHAR(6),
                ADMDEPT CHAR(2))
    END-EXEC