Get Column Schema - Parallel Transporter

Teradata® Parallel Transporter Operator Programmer Guide

Product
Parallel Transporter
Release Number
17.10
Published
June 2021
Language
English (United States)
Last Update
2021-07-01
dita:mapPath
igj1608578346674.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2435
lifecycle
previous
Product Category
Teradata Tools and Utilities

Purpose

Get Column Schema is the service function that retrieves the column schema associated with a column.

Structure

#include <pxoper.h>
PXSTC_Code PX_GetColumnSchema(
   PX_ColumnSchemaHandle  columnHandle,
   PX_ColumnName *columnName,
   PX_DataType *  dataType,
   PX_Length *  dataLength,
   PX_ByteOffset *  offset,
   PX_Precision *  precision,
   PX_Scale *  scale,
   PX_TruthValue *  nullIndicator);

where the following is true:

Parameter Function Specification
columnHandle output Column handle from which the column schema is to be obtained.
columnName output Column-name attribute of the column schema.
dataLength output Column length for both numeric and nonnumeric data types.
dataType output Data type attribute of the column schema.
nullIndicator output Truth value indicating whether or not the column value can be NULL.
offset output Column position in terms of the number of bytes into the data row.

An offset specification of -1 signifies that no column position is defined.

precision output Precision value (number of digits) for a numeric data type.

The precision specification can range from 1 to 38.

scale output Scale value (number of digits to the right of the decimal point) for a numeric data type.

Return Codes

The following Get Column Schema function status codes are defined by the Teradata PT operator interface:

Status Code Signifies
PXSTC_InvalidArgument One or more bad input arguments.
PXSTC_BadHandle An undefined column schema handle.
PXSTC_Success Successful retrieval of the column schema.

Usage Notes

Consider the following when defining thee Get Column Schema function.

Topic Usage Notes
Status If the function status is PXSTC_Success the values of the output parameters are returned. See also Create Column Schema.