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:
Valid abbreviations in data type specifications are:
|
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. |