FNC_GetDatasetSchema Function | C Library Functions | Teradata Vantage - 17.10 - FNC_GetDatasetSchema - 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)

Retrieves the schema for a DATASET data type instance.

Syntax

void
FNC_GetDatasetSchema ( DATASET_HANDLE              datasetHandle,
                       void*                       schemaBuf,
                       int                         schemaBufLen,
                       int*                        actualSchemaLength,
                       dataset_schema_encoding_t   schemaEncoding)

Syntax Elements

datasetHandle
A handle to a DATASET data type instance that is defined to be an input parameter to an external routine.
schemaBuf
Return parameter that contains the UNICODE characters in JSON format representing the schema.
schemaBufLen
The length of the buffer used to store the schema, in bytes.
actualSchemaLength
Return parameter specifying the length of the schema for this DATASET data type instance, in bytes.
schemaEncoding
The encoding in which the user would like to retrieve the schema.

Usage Notes

FNC_GetDatasetSchema can be used to retrieve the schema of a DATASET data type, regardless of storage format or size. The schema is returned as UNICODE text, encoded in either UTF-8 or UTF-16, depending on the value of the schemaEncoding parameter.

Note that the schema is returned without any special formatting, in its JSON encoding and with UNICODE characters.

Use FNC_GetDatasetInfo to determine the appropriate buffer size that can store the schema. If the buffer passed into this routine is too small to contain the entire schema, an error is reported.

For best performance, Use FNC_GetDatasetSchema when the schema is not stored as a LOB. If FNC_GetDatasetInfo returns schemaLob = 0, you can use FNC_GetDatasetSchema; otherwise, you should use FNC_GetDatasetSchemaLob instead.