BSON_TO_JSON
The BSON_TO_JSON function converts a string containing formatted BSON data to a character string containing the data formatted as JSON.
- JSON-expression
-
Specifies an expression that returns a binary string value. It must contain formatted BSON data.
If JSON-expression contains duplicate keys, the duplicate keys are retained in the result JSON string.
The data type of the result is CLOB(2G) with a CCSID of 1208.
If the argument can be null, the result can be null; if the argument is null, the result is the null value.
Example
- Insert a value that contains data formatted as BSON into a column that holds JSON
values.
INSERT INTO TABLE1 (JSON_COLUMN) VALUES (BSON_TO_JSON(:BSON_DATA));