15.10 - AsBSON - Teradata Database

Teradata Database Teradata JSON

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1150-151K

Purpose

The AsBSON method returns the BSON representation of the specified JSON instance.

Syntax



Syntax Elements

JSON_expr
An expression that evaluates to a JSON data type.
The JSON data can be stored in any of the supported storage formats.
STRICT
The data is validated according to the BSON specification located at http://bsonspec.org/ and the MongoDB restrictions specified in http://docs.mongodb.org/meta-driver/latest/legacy/bson/.
The character string 'STRICT' is not case sensitive. For example, you can also specify 'strict'.
LAX
The data is validated according to the BSON specification located at http://bsonspec.org/. This is the default behavior if you do not specify 'STRICT' or 'LAX'.
The character string 'LAX' is not case sensitive. For example, you can also specify 'lax'.

Return Value

A BLOB value representing the input JSON data in BSON format.

A Teradata NULL is returned if the JSON_expr argument is NULL.

Usage Notes

You can use the AsBSON method to get the BSON representation of JSON data that is stored in another storage format, such as text or UBJSON.

If the input JSON data is already stored as BSON, this method merely returns the data passed into it.