FNC_GetDatasetSchema Function | C Library Functions | Teradata Vantage - FNC_GetDatasetSchema - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

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.