Purpose
Update Global Variable is the service function that assigns a value to a global variable.
Structure
#include <pxoper.h> PXSTC_Code PX_UpdateGlobalVar(PX_OperatorHandle operator, PX_Name varName, PX_Addr itemBufferAddr, PX_Length itemBufferSize); PX_Count itemIndex,
where the following is true:
| Parameter | Function | Specification |
|---|---|---|
| itemBufferAddr | input | Address of the buffer where the value to be assigned to the global variable is stored. |
| itemBufferSize | input | Size of the value in the item buffer. |
| itemIndex | input | Item of the global variable to be updated. The itemIndex parameter can range from 1 to the maximum limit specified when the global variable was created. |
| operator | input | Operator handle by which the global variable is to be updated. |
| varName | input | Name of the global variable. |
Return Codes
The following Update 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 operator handle. |
| PXSTC_LengthError | The length of the update value does not match the length of the global variable buffer. |
| PXSTC_NotEnough | The global variable is too large. |
| PXSTC_Success | A successful update access of the global variable. |
Usage Notes
Consider the following when defining the Update Global Variable function.
| Topic | Usage Notes |
|---|---|
| Status | If the function status is PXSTC_Success, the value stored at the itemBufferAddr location is assigned to the specified itemIndex of the varName global variable. |
| See Also |
|