16.10 - Examples of DEFINE SCHEMA Statements - Parallel Transporter

Teradata Parallel Transporter Reference

Product
Parallel Transporter
Release Number
16.10
Published
July 2017
Content Type
Programming Reference
Publication ID
B035-2436-077K
Language
English (United States)

The following table lists examples of DEFINE SCHEMA statements.

Examples of DEFINE SCHEMA Statements
Example Statement Example
Example 1
DEFINE SCHEMA PRODUCT_SOURCE_SCHEMA
   DESCRIPTION 'PRODUCT INFORMATION'
(
   PRODUCT_NAME                 VARCHAR(24),
   PRODUCT_CODE                 INTEGER,
   PRODUCT_DESCRIPTION          VARCHAR(512),
   PRODUCT_COST                 INTEGER,
   PRODUCT_PRICE                INTEGER,
   PRODUCT_WARRANTY             CLOB(50000),
   PRODUCT_PICTURE              BLOB (40000000) AS DEFERRED BY NAME
);
Example 2
DEFINE SCHEMA FREQ_FLYER_SRC
ADJUST UNICODE
DESCRIPTION 'SCHEMA FOR FREQUENT FLYER SOURCE FILE'
(
   RES_ID VARCHAR(14),
   FLIGHT_NO SMALLINT,
   ORIGIN CHAR(3),
   DEST CHAR(3),
   TKT_ID CHAR(12),
   TKT_ISSUE_DATE ANSIDATE,
   TKT_AMT DECIMAL(5,2),
   TRAVEL_AGCY_ID CHAR(4),
   FREQ_MILES_ID CHAR(8)
);
Example 3
DEFINE SCHEMA PRODUCT_SOURCE_SCHEMA
DESCRIPTION 'PRODUCT INFORMATION'
(
   PRODUCT_CODE                INTEGER,
   PRODUCT_NAME                VARCHAR(24)   MACROCHARSET UNICODE,
   PRODUCT_DESCRIPTION         VARCHAR(512)  MACROCHARSET LATIN,
   PRODUCT_TYPE                CHAR(2)       MACROCHARSET KANJI,
   PRODUCT_COST                INTEGER,
   PRODUCT_PRICE               INTEGER
);
Example 4
DEFINE SCHEMA EMPLOYEE_SCHEMA
DESCRIPTION 'SAMPLE EMPLOYEE SCHEMA'
(
   EMP_ID      INTEGER,
   EMP_NAME    CHAR(30),
   EMP_DEPT    INTEGER,
   JOBDURATION PERIOD(DATE) USINGEXTENSION('AS VALIDTIME')
);
Example 5
DEFINE SCHEMA EMPLOYEE_SCHEMA
DESCRIPTION 'SAMPLE EMPLOYEE SCHEMA'
(
   EMP_ID       INTEGER,
   EMP_NAME     CHAR(30),
   EMP_DEPT     INTEGER,
   JOB_START    INTDATE,
   JOB_END      INTDATE USINGEXTENSION('PERIOD FOR JOBDURATION
                                     (JOB_START, JOB_END) AS VALIDTIME')
);