17.10 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

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

FNC_GetJSONInfo takes a JSON type instance as an input argument. The JSON type instance is passed to the function as a JSON handle. The function returns:

  • The maximum possible length, in bytes, of the JSON type instance specified by jsonHandle. This information is returned in the maxLength parameter.
  • The character set of the JSON type instance specified by jsonHandle. This information is returned in the charset parameter. The return value is one of the following as defined in sqltypes_td.h:
    • LATIN_CT
    • UNICODE_CT
  • An indication of whether or not the JSON data is stored as a LOB. This is specified by the numLobsparameter.

    Based on the numLobsvalue, the user can determine which FNC routines to use for reading and writing JSON data:

    • If the JSON data is not stored as a LOB, you must use FNC_GetInternalValue or FNC_SetInternalValue.
    • If the JSON data is stored as a LOB, you must use FNC_GetJSONInputLob or FNC_GetJSONResultLob together with the LOB FNC routines.