Creating a column to store JSON data

JSON data can be stored in BSON format in a column in Db2.

About this task

Procedure

To create a column to store JSON data:

Issue the CREATE TABLE SQL statement and specify BLOB as the data type for the column to contain JSON data.

Example

The following example creates a CALL_RECORDS column to store JSON data.
CREATE TABLE CLAIMS (CLAIM_ID       VARCHAR(10),
                     POLICY_NUM     VARCHAR(12),
                     CUSTOMER_ID    VARCHAR(8),
                     STATUS         VARCHAR(20),
                     CALL_RECORDS   BLOB);