JSON Data Type | JSON Type Transform Groups | VantageCloud Lake - JSON Type Transform Groups - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Vantage automatically generates the fromsql and tosql functionality associated with the transform of a newly created JSON type. By default, the JSON string is transformed to and from a CLOB(length) value, where length depends on the data. The character set is either UNICODE or LATIN depending on the JSON type instance. The format of the transformed output string conforms to the standard JSON string syntax.

Support for Multiple Transform Groups

The JSON type in Field, Record, and Indicator modes uses transforms. The JSON type has the following predefined transform groups to convert objects to CLOB, BLOB, VARCHAR, and VARBYTE.

Transform Group Complex Data Type Primary Type Default Format
TD_JSON_CLOB JSON

CLOB(16776192) CHARACTER SET LATIN

or

CLOB(8388096) CHARACTER SET UNICODE

Yes Text format in the same character set as the JSON type instance
TD_JSON_BLOB JSON BLOB(16776192) No BSON format
TD_JSON_VARCHAR JSON

VARCHAR(64000) CHARACTER SET LATIN

or

VARCHAR(32000) CHARACTER SET UNICODE

No Text format in the same character set as the JSON type instance
TD_JSON_VARBYTE JSON VARBYTE(64000) No BSON format

You can use the TRANSFORM option in the CREATE PROFILE/MODIFY PROFILE or CREATE USER/MODIFY USER statements to specify for a user the transform group to use for a given data type.

Use the SET TRANSFORM GROUP FOR TYPE statement to change the active transform group in the current session. You can use this statement multiple times for a data type to switch from one transform group to another within the session. If the logon user already has transform settings, the statement modifies the transform settings for the current session.

Transform Group Macros

You can use the following macros to find the transform group for a CDT, or the transform group settings for a user, profile, or current session.

Macro Description
SYSUDTLIB.HelpCurrentUserTransforms Lists the transform group settings of the current logon user.
SYSUDTLIB.HelpCurrentSessionTransforms Lists the transform group settings of the current session.
SYSUDTLIB.HelpUserTransforms(User) Lists the transform group settings for a specific user.
SYSUDTLIB.HelpCurrentUDTTransform(UDT) Lists the transform group settings of the current session for the specified UDT.
SYSUDTLIB.HelpProfileTransforms(Profile) Lists the transform group settings for a specific profile.