Purpose
Create Global Variable is the service function that creates a global variable for the operator.
Structure
#include <pxoper.h> PXSTC_Code PX_CreateGlobalVar(PX_OperatorHandle operator, PX_Name varName, PX_Length varSize, PX_Count varCount);
where the following is true:
| Parameter | Function | Specification |
|---|---|---|
| operator | input | Instance of the operator handle for which the global variable is being created. |
| varCount | input | Maximum number items to be created for the global variable. |
| varName | input | Name of the global variable. |
| varSize | input | Item size of the global variable, in bytes. |
Return Codes
The following Create Global Variable 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 object handle. |
| PXSTC_NotEnough | The global variable size is too large |
| PXSTC_Success | Successful creation of the global variable. |
Usage Notes
Consider the following when using the Create Global Variable function.
| Topic | Usage Notes |
|---|---|
| Status | If the function status is PXSTC_Success, all items of the global variable were created successfully. |