JSON data can be stored in the following formats:
- Text (LATIN or UNICODE)
- Binary JSON (BSON)
- Universal Binary JSON (UBJSON)
The default storage format is text in the character set specified (or the default character set for the user).
You can use the optional STORAGE FORMAT clause to specify that the JSON data be stored in one of the binary formats (BSON or UBJSON). This clause can only be used in the following cases:
- As an attribute of a table column
- As part of a JSON data type declaration in a CAST expression
- As an optional parameter to the JSON constructor
You can use HELP COLUMN to display the storage format of a JSON column.
You cannot define a JSON type with both a STORAGE FORMAT clause and a CHARACTER SET clause. For JSON data stored in a binary format, the character set for this data when exported as text is UNICODE. Therefore, no CHARACTER SET clause is needed for these formats.