Examples: Casting to the JSON Type and Specifying a Storage Format

Teradata Vantage™ JSON Data Type

brand
Software
Teradata Vantage
prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1150-162K

The following SELECT statements return the following result:

{"hello":"world"}
SELECT CAST('160000000268656C6C6F0006000000776F726C640000'xb AS JSON STORAGE FORMAT BSON);

SELECT CAST('{"hello":"world"}' AS JSON STORAGE FORMAT BSON);

SELECT CAST('{"hello":"world"}' AS JSON STORAGE FORMAT UBJSON);

SELECT CAST(NEW JSON('{"hello":"world"}') AS JSON STORAGE FORMAT BSON);

SELECT CAST(NEW JSON('{"hello":"world"}') AS JSON STORAGE FORMAT UBJSON);

SELECT CAST(NEW JSON('{"hello":"world"}',LATIN) AS JSON STORAGE FORMAT BSON);

SELECT CAST(NEW JSON('{"hello":"world"}',LATIN) AS JSON STORAGE FORMAT UBJSON);

SELECT CAST(NEW JSON('{"hello":"world"}',UNICODE) AS JSON STORAGE FORMAT BSON);

SELECT CAST(NEW JSON('{"hello":"world"}',UNICODE) AS JSON STORAGE FORMAT UBJSON);

SELECT CAST(NEW JSON('160000000268656C6C6F0006000000776F726C640000'xb, BSON) AS JSON STORAGE FORMAT UBJSON);