FNC_GetDatasetSchema Function | C Library Functions | Teradata Vantage - FNC_GetDatasetSchema - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
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.