7.5.2 Defining a table

The RDAREA storage unit depends on the data type of the columns that constitute the table. The explanations below are based on the example of a STAFF_TABLE table that consists of EMPLOYEE_NUMBER, DOCUMENT_DATA (LOB data), and abstract data type t_EMPLOYEE. For a table containing abstract data type columns, the portion without the abstract data type columns is called the abstract data type column structure base table.

[Figure]

Explanation:
STAFF_TABLE is divided among and stored in user RDAREAs RDAREA01 and RDAREA02 on disks A and B, respectively. DOCUMENT_DATA of this STAFF_TABLE (LOB column) is stored in user LOB RDAREAs LOBAREA01 and LOBAREA02, and the abstract data type (LOB attribute) ID_PHOTO is stored in user LOB RDAREAs LOBAREA03 and LOBAREA04.
Organization of this subsection
(1) Key range partitioning
(2) Flexible hash partitioning or FIX hash partitioning

(1) Key range partitioning

Specification of storage conditions:

CREATE TABLE STAFF_TABLE
(EMPLOYEE_NUMBER CHAR(6),
DOCUMENT_DATA BLOB(64K) IN ((LOBAREA01),(LOBAREA02)),
EMPLOYEE t_EMPLOYEE ALLOCATE(ID_PHOTO
    IN ((LOBAREA03),(LOBAREA04)))
   )IN ((RDAREA01)EMPLOYEE_NUMBER<=700000,(RDAREA02));

Specification of boundary value:

CREATE TABLE STAFF_TABLE
(EMPLOYEE_NUMBER CHAR(6),
DOCUMENT_DATA BLOB(64K) IN ((LOBAREA01),(LOBAREA02)),
EMPLOYEE t_EMPLOYEE ALLOCATE(ID_PHOTO
    IN ((LOBAREA03),(LOBAREA04)))
   )PARTITIONED BY EMPLOYEE_NUMBER
    IN ((RDAREA01)800000,(RDAREA02));

(2) Flexible hash partitioning or FIX hash partitioning

CREATE TABLE STAFF_TABLE
(EMPLOYEE_NUMBER CHAR(6),
DOCUMENT_DATA BLOB(64K) IN ((LOBAREA01),(LOBAREA02)),
EMPLOYEE t_EMPLOYEE ALLOCATE(ID_PHOTO
    IN ((LOBAREA03),(LOBAREA04)))
   )[FIX]* HASH HASH6 BY EMPLOYEE_NUMBER
    IN (RDAREA01,RDAREA02);

* This specification is applicable to FIX hash partitioning.