BSON2JSON

The BSON2JSON function converts a JSON document in binary format (extended BSON) into a readable JSON text format.

Read syntax diagramSkip visual syntax diagram BSON2JSON ( json-value )

The schema is SYSTOOLS.

json-value
A BLOB column of a base table. The json-value value must contain a BSON representation of a JSON document.

The result is a CLOB (16 MB) that contains a JSON document in a readable text format. If the input value does not contain a valid BSON formatted expression, or if the converted value cannot fit into a 16 MB CLOB, an error is returned.

Since the data that is stored in a JSON column is in a special binary format that is called BSON, selecting from the field only results in displaying random characters. If you want to extract the contents of a JSON field as JSON, then you must use the BSON2JSON function.