Purpose
The StorageSize method returns the number of bytes needed to store the input JSON data in the specified storage format.
Syntax
Syntax Elements
- JSON_expr
- An expression that evaluates to a JSON data type.
- storage_format
- One of the following character strings, or an expression that evaluates to one of these string values:
- 'LATIN_TEXT'
- 'UNICODE_TEXT'
- 'BSON'
- 'UBJSON'
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.