The following table lists 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') ); |
Example 6 | DEFINE SCHEMA INVENTORY_SCHEMA1 DESCRIPTION 'SAMPLE INVENTORY SCHEMA' ( FILE_NAME VARCHAR(30) METADATA(FILENAME), REC_NUMBER BIGINT METADATA(FILERECORDNUMBER), ITEM_NUMBER INTEGER, DESCRIPTION VARCHAR(100), QUANTITY INTEGER, PRICE DECIMAL(6,2) ); |
Example 7 | DEFINE SCHEMA INVENTORY_SCHEMA2 DESCRIPTION 'SAMPLE INVENTORY SCHEMA' ( ITEM_NUMBER INTEGER, DESCRIPTION VARCHAR(100), QUANTITY INTEGER, PRICE DECIMAL(6,2), REC_NUMBER INTEGER METADATA(FILERECORDNUMBER), FILE_NAME CHAR(25) METADATA(FILENAME) ); |