15.10 - StorageSize - Teradata Database

Teradata Database Teradata JSON

Teradata Database
December 2015
Programming Reference


The StorageSize method returns the number of bytes needed to store the input JSON data in the specified storage format.


Syntax Elements

An expression that evaluates to a JSON data type.
The JSON data can be stored in any of the supported storage formats.
One of the following character strings, or an expression that evaluates to one of these string values:
  • 'BSON'
  • 'UBJSON'
These string values are not case sensitive.
If you do not specify a storage format, the default format used by the method is the storage format of the input JSON data.

Return Value

An INTEGER value representing the number of bytes required to store the input JSON data in the format specified by the storage_format argument.

It is possible that the value returned by this method may change in the future because these storage formats are not guaranteed to remain unchanged.

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

Usage Notes

This method is very helpful in estimating the benefits derived from a particular storage format for a specified set of data. Because the JSON data need not be stored in a table to invoke this method, you can use it to determine which storage format best suits a particular set of data before loading it into a table.