15.10 - StorageSize - 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 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.
The JSON data can be stored in any of the supported storage formats.
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'
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.