17.00 - Create Column Schema - Parallel Transporter

Teradata® Parallel Transporter Operator Programmer Guide

prodname
Parallel Transporter
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-2435-220K

Purpose

Create Column Schema is the service function that creates the schema for a column.

Structure

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

where the following is true:

Parameter Function Specification
columnHandle output Column handle for which the schema is being created.
columnName input Column-name attribute of the column schema.
dataLength input Column length for both numeric and nonnumeric data types.
dataType input Data type attribute of the column schema.
nullIndicator input Truth value indicating whether or not the column value can be NULL.
offset input 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 input Precision value (number of digits) for a numeric data type.

The precision specification can range from 1 to 38.

scale input Scale value (number of digits to the right of the decimal point) for a numeric data type.
tableSchemaHandle input Data schema handle by which the column schema will be created.

Return Codes

The following Create 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 data schema handle.
PXSTC_Success Successful creation of the column schema definition.

Usage Notes

Consider the following when using the Create Column Schema function.

Topic Usage Notes
Data Type Specifications Teradata PT supports the following data type specifications:
  • PX_DataType_Integer
  • PX_DataType_SmallInt
  • PX-DataType_LongInt
  • PX_DataType_Float
  • PX_DataType_Decimal
  • PX_DataType_Char
  • PX_DataType_ByteInt
  • PX_DataType_VarChar
  • PX_DataType_Byte
  • PX_DataType_VarByte
  • PX_DataType_Graphic
  • PX_DataType_VarGraphic
  • PX_DataType_Date
  • PX_DataType_Date_ANSI
  • PX_DataType_Boolean
Valid abbreviations in data type specifications are:
  • CHARACTERS as:

    CHARACTER

    CHARS

    CHAR

  • DECIMAL as DEC
  • INTEGER as INT
Status If the function status is PXSTC_Success, the column schema will be stored in the location indicated by the columnHandle pointer. See also the Get Column Schema function.