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.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

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)
DATASET_HANDLE datasetHandle
A handle to a DATASET data type instance that is defined to be an input parameter to an external routine.
void* schemaBuf
Return parameter that contains the UNICODE characters in JSON format representing the schema.
int schemaBufLen
The length of the buffer used to store the schema, in bytes.
int* actualSchemaLength
Return parameter specifying the length of the schema for this DATASET data type instance, in bytes.
dataset_schema_encoding_t 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.