The following fields of the StatementInfo Parcel contain information relevant to a particular instance of the JSON data type and show typical values that are expected for the JSON data type:
- Data Type Code = JSON Data Type, according to the table in the Data Type Encoding section.
- UDT indicator = 0 (JSON data type is treated as a system built-in type)
- Fully qualified type name length = 0
- Fully qualified type name = ""
- Field Size = the maximum possible length in bytes for this particular JSON instance
- Character Set Code = 1 or 2, depending on the character set for this particular JSON instance
- Maximum number of characters = number of characters of the JSON column - the same as number in the column definition
- Case Sensitive: 'Y' (JSON is case specific)
The "Data Type Misc Info" field provides information about the storage format of a JSON type.
Example: Metadata Parcel Sequence
This example shows a statement and the associated Metadata Parcel Sequence.
Consider the following table, data, and query.
CREATE SET TABLE jsontab ,NO FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKRATIO ( id INTEGER, jsoncol JSON(543000) CHARACTER SET UNICODE) PRIMARY INDEX ( id ); INSERT INTO jsontab VALUES(1, NEW JSON('{"name":"Cameron"}', LATIN)); SELECT jsoncol FROM jsontab;
When executing the SELECT statement, the StatementInfo parcel looks like the following:
Database Name | test_db |
Table/View Name | jsontab |
Column Name | jsoncol |
Column Index | 2 |
As Name | |
Title | jsoncol |
Format | |
Default Value | |
Is Identity Column | N |
Is Definitely Writable | Y |
Is Nullable | Y |
Is Searchable | Y |
Is Writable | Y |
Data Type Code | 881 (JSON Nullable) |
UDT Indicator | 0 |
UDT Name | |
UDT Misc | |
Max Data Length | 1086000 (for UTF16 Session Character Set; 543000 * 2 [export factor]) |
Digits | 0 |
Interval Digits | 0 |
Fractional Digits | 0 |
Character Set Code | 2 |
Max Number of Characters | 543000 |
Is CaseSensitive | Y |
Is Signed | U |
Is Key Column | N |
Is Unique | N |
Is Expression | N |
Is Sortable | N |
Parameter Type | U |
Struct Depth | 0 |
Is Temporal Column | 0 |
UDT Attribute Name | |
Server Data Type Code | 0 |
Array Number of Dims | 0 |