SQL$HELP_OLD72.HLB  —  DECLARE  TABLE  Examples
    Example 1: Declaring the table EMPLOYEES in a COBOL program

    EXEC SQL
    DECLARE EMPLOYEES TABLE
        (EMPLOYEE_ID                      CHAR (5)
           CONSTRAINT     EMP_EMPLOYEE_ID_NOT_NULL
           NOT NULL,
         LAST_NAME                        CHAR (14),
         FIRST_NAME                       CHAR (10),
         MIDDLE_INITIAL                   CHAR (1),
         ADDRESS_DATA_1                   CHAR (25),
         ADDRESS_DATA_2                   CHAR (25),
         CITY                             CHAR (20),
         STATE                            CHAR (2),
         POSTAL_CODE                      CHAR (5),
         SEX                              CHAR (1),
           CONSTRAINT     EMP_SEX_VALUES
           CHECK          (
                          SEX IN ('M', 'F') OR SEX IS NULL
                          ),
         BIRTHDAY                         DATE ,
         STATUS_CODE                      CHAR (1)
           CONSTRAINT     EMP_STATUS_CODE_VALUES
           CHECK          (
                          STATUS_CODE IN ('0', '1', '2')
                          OR STATUS_CODE IS NULL
                          )
         )
    END_EXEC
Close Help