17.10 - JSON Data Type (Binary Format) - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Database Design

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
User Guide
Publication ID
B035-1094-171K
Language
English (United States)

The JSON data type can be stored in binary format (BSON). Specify BSON with the optional STORAGE FORMAT clause in the data type specification syntax.

BSON data can be stored inline (inside a row) or outside the row in a LOB subtable or both, depending on the syntax used to specify it:

Syntax Default Inline Storage Maximum Length LOB/Non-LOB
JSON(n) STORAGE FORMAT BSON, where n <= 64,000 n bytes n bytes Non-LOB
JSON(n) STORAGE FORMAT BSON, where n > 64,000 4,096 bytes n bytes LOB
JSON(n) STORAGE FORMAT BSON INLINE LENGTH m m bytes n bytes

If n <= m, Non-LOB

Otherwise, LOB

If there is no column length specified, the default length is the maximum. The BSON type has a maximum total size of 16 MB (16,776,192 bytes).

The maximum size for BSON reflects the number of bytes in the data. This is different than the case for JSON text, where the maximum size reflects the number of characters in the data.

For more information on the JSON data type, see Teradata Vantageā„¢ - JSON Data Type, B035-1150.