Connection Class
The Connection class manages all of the attributes required to connect to the Teradata Database. These attributes store attribute, schema and DML Group objects.
Note: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Notes have been made for the following syntax examples to use #include “connecti.h” instead of “connection.h.”
Object Name and Function |
Syntax and Notes |
Return Codes |
AddArrayAttribute Adds a connection attribute with more than one value. |
#include “connection.h”
Void
TD_Count count,
Char* value, ..., Void
TD_Count count,
TD_IntValue value, ..., where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
None |
AddAttribute Adds a connection attribute. |
#include “connection.h”
Void Void
TD_IntValue value);
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
None |
AddDMLGroup Adds a DMLGroup object to the connection. |
#include “connection.h”
TD_StatusCode
TD_Index* index);
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Error, TD_Success See “Teradata PT Status Messages” on page 72 for more information. |
AddSchema Adds a schema object to the connection. A schema is the definition of the columns in a table or data source. An input schema defines the fields in a record of input data. |
#include “connection.h”
void
where the schema parameter is input for the pointer to the schema object. On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
None |
AddSchema Adds schema to the connection object retrieved via GetSchema (char **schema_buff, TD_Count *numCols, TD_Length *length) Returns a schema object in a schema pointer. |
#include “connection.h”
where:
This method is capable of adding the schema to the connection object before the initiate phase is complete. The method is only used for the dynamic schema feature with multiple instances. |
None |
AddValue (char*) Adds character value to the attribute. |
#include "connection.h"
void AddValue(char* value);
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
None |
AddValue (int) Adds integer value to the attribute. |
#include "connection.h"
void AddValue(int value);
* On mainframe-attached z/OS platforms connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
None |
ApplyRows Applies the data loaded in the acquisition phase. (Load and Update only). |
#include “connection.h”
TD_StatusCode
On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Error, See “Teradata PT Status Messages” on page 72 for more information. |
Checkpoint Tells the driver to perform a checkpoint. |
#include “connection.h”
TD_StatusCode
where these parameters specify: The checkpoint method currently returns NULL with a data length of zero. These Checkpoint parameters are reserved for future expansion. See “Add Checkpoint and Restart” on page 33 for more information. On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Call_EndAcq, See “Teradata PT Status Messages” on page 72 for more information. |
Class Constructor Returns the Connection class instance. |
#include “connection.h”
using namespace teradata::client::API;
Connection* Connection( );
On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
None |
Class Constructor Specifies encoding for the Connection class and returns the Connection class instance. |
#include “connection.h”
using namespace teradata::client::API;
Connection* Connection(TD_Encoding);
Valid values are TD_UTF8_ENCODING (the default) and TD_UTF16_ENCODING. This Class Constructor is not supported on mainframe‑attached z/OS platforms. |
None |
EndAcquisition Informs the driver that the data acquisition phase is completed. This function must be called before the data can be applied. |
#include “connection.h”
TD_StatusCode
On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_END_Method, TD_Error, TD_SYNC_Barrier, TD_SYNC_TELINFO See “Teradata PT Status Messages” on page 72 for more information. |
GetBuffer Retrieves a buffer full of rows from the Teradata Database. Exporting by the buffer provides a performance improvement over exporting one row at a time. Data is in null indicator mode. See “Load Data into or Export Data from the Teradata Database” on page 27 for more information. |
#include “connection.h”
TD_StatusCode
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_END_Method, TD_Error, TD_SYNC_Barrier, TD_SYNC_TELINFO, TD_Success See “Teradata PT Status Messages” on page 72 for more information. |
GetCheckPointInterval Returns the checkpoint interval. |
#include "connection.h"
int Connection::GetCheckPointInterval()
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
Returns the integer holding the check point interval. |
GetCount Gets the count of the attributes. |
#include "connection.h"
int GetCount();
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
Returns an integer holding the count of attributes. |
GetEncoding Returns the character set encoding type |
#include "connection.h"
TD_Encoding Connection::GetEncoding ()
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
TD_UTF8_ENCODING TD_UTF16_ TD_EBCDIC_ |
GetErrorInfo Retrieves detailed information about the last error received. |
#include “connection.h”
Void
TD_ErrorType* errorType);
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
None |
GetEvent Retrieves runtime statistics from the driver. |
#include “connection.h”
TD_StatusCode
char** eventData,
TD_Length* eventDataLen,
TD_Index eventIndex = 0);
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_END_Method, TD_Error, TD_SYNC_Barrier, TD_SYNC_TELINFO, TD_Unavailable See “Teradata PT Status Messages” on page 72 for more information. |
GetName Gets the name of the attribute. |
#include ""connection.h"
char* GetName();
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
Returns the character pointer holding the attribute name. |
GetRow Retrieves a row of data from the Teradata Database. Data is in null indicator mode. |
#include “connection.h”
TD_StatusCode
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_END_Method, TD_Error, TD_Success, TD_SYNC_Barrier, TD_SYNC_TELINFO See “Teradata PT Status Messages” on page 72 for more information. |
GetSchema Retrieves the schema. |
#include “connection.h”
TD_StatusCode
where schema is the output schema pointer. On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Error, TD_Success TD_Unavailable See “Teradata PT Status Messages” on page 72 for more information. |
GetSchema Retrieves schema in a buffer in encrypted form |
#include “connection.h”
where: These values are only meaningful to AddSchema (Schema **schema, char *colInfo, TD_Length numCols); method. This method is only used for the dynamic schema feature with multiple instances. |
TD_Success TD_Unavailable TD_Error |
GetTELINFO Retrieves the TELINFO area from the master instance in a multi‑instance environment. |
#include “connection.h”
TD_StatusCode
GetTELINFO(
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Error, TD_Success See “Teradata PT Status Messages” on page 72 for more information. |
GetTPTAPIVersion Copies the TPTAPI version to the user-provided version variable. |
#include "connection.h"
void GetTPTAPIVersion (char *version);
where this parameter specifies: You must allocate sufficient memory for version. A minimum of 50 bytes is ideal. A null-terminated TPTAPI version string is copied to version. |
None |
GetType Gets the attribute type. |
#include "connection.h"
int GetType();
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT).Use #include "connecti.h" instead of "connection.h" |
Returns the integer holding the attribute type: 1 mType = 0 (if non-array or non-multivalue) 2 mType = 1 (if array or multivalue) 3 mType = 2 (if integer) |
GetUpperValue Change the attribute from lower case to upper case. |
#include "connection.h"
char* GetUpperValue(int index = 0);
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
Returns the character pointer holding the attribute in upper case. |
GetValue Gets the specific attribute. |
#include "connection.h"
char* GetValue(int index = 0);
* On mainframe-attached z/OS platforms, |
Returns the character pointer holding the specific attribute. |
Initiate Processes the Connection class attributes, schemas, and DML groups; initializes the driver and SQL. Teradata FastLoad, Teradata FastExport, and Teradata MultiLoad sessions are connected by the driver. |
#include “connection.h”
TD_StatusCode
On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_END_Method, TD_Error, TD_SYNC_Barrier, TD_SYNC_TELINFO See “Teradata PT Status Messages” on page 72 for more information. |
MakeArray Consolidates attribute values into array values and sets the array attribute properties. |
#include "connection.h"
void MakeArray(char spaceValues);
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
None |
PutBuffer Sends a buffer of data to the Teradata Database. Eliminates the extra data movement to the CLIv2 Data or IndicData. See Load Data into or Export Data from the Teradata Database for more information. |
#include “connection.h”
TD_StatusCode
TD_Boolean indicator);
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Call_EndAcq, See “Teradata PT Status Messages” on page 72 for more information. |
PutEvent Modifies the driver at runtime. |
#include “connection.h”
TD_StatusCode
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_EndMethod, See “Teradata PT Status Messages” on page 72 for more information. |
PutRow Sends a row of data to the Teradata Database. Data must be in null indicator mode format. |
#include “connection.h”
TD_StatusCode
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Call_EndAcq, See “Teradata PT Status Messages” on page 72 for more information. |
PutTELINFO Used by the slave to store the TELINFO area passed from the master in a multi-instance environment. |
#include “connection.h”
TD_StatusCode
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Error, TD_Success See “Teradata PT Status Messages” on page 72 for more information. |
Restart Causes the driver to restart at the point of the last checkpoint. |
#include “connection.h”
TD_StatusCode
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_END_Method, TD_Error, See “Teradata PT Status Messages” on page 72 for more information. |
SetCount Sets the count of the attributes. |
#include "connection.h"
void SetCount(int c);
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
None |
SetValue Sets the character value to a specific attribute. |
#include "connection.h"
void SetValue(char* value, int index = 0);
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include ""connecti.h"" instead of ""connection.h |
None |
SetValue Sets the integer value to a specific attribute. |
#include "connection.h"
void SetValue(int value, int index = 0);
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include" connecti.h" instead of "connection.h" |
None |
SetType Sets the attribute type. |
#include "connection.h"
void SetType(int t);
* On mainframe-attached z/OS platforms, connection.h is located in TWB.H(CONNECT). Use #include "connecti.h" instead of "connection.h" |
None |
Terminate Closes the driver and disconnects all sessions. |
#include “connection.h”
TD_StatusCode
On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_END_Method, TD_Error, TD_SYNC_Barrier, TD_SYNC_TELINFO See “Teradata PT Status Messages” on page 72 for more information. |
UseDMLGroups Designates which DML group to use. |
#include “connection.h”
TD_StatusCode
TD_Count count);
where these parameters specify: On mainframe‑attached z/OS platforms, connection.h is located in TWB.H(CONNECTI). Use #include “connecti.h” instead of “connection.h.” |
TD_Error, TD_Success See “Teradata PT Status Messages” on page 72 for more information. |