Need help for TPT API

UDA

Need help for TPT API

Hi,
I am new to Teradata. I want to use TPT API for bulk upload stuff. I got sample from Tearadata site for bulk upload, but when we are running that code, we get following error - PutRow failed on row 1 with status 224

I am assuming that the code is failing in initializing connection object. If any one has worked on it, can you please help us out.

Giving below the code snippet which we got from Teradata PT API sample and detail error for the same --

char * user_name = strdup(m_om->getUserName().c_str());

char * user_password = strdup(m_om->getUserPassword().c_str());

char * target_table = strdup(m_om->getTargetTable().c_str());

char * tdp_id = strdup(m_om->getTdpId().c_str());

char * dml_statment = (char*)malloc(1024);

sprintf(dml_statment, "INSERT INTO %s ( :Associate_Id, :Associate_Name,:Martial_Status);", m_om->getTargetTable().c_str());

cout << "*** Load Driver Example ***" << endl; /* DR97368 */

ncr::teradata::client::API::Connection *conn = new Connection();

/**********************************************

* Set Operator Type and Trace/Log Levels

**********************************************/

conn->AddAttribute(TD_SYSTEM_OPERATOR,TD_LOAD);

/**********************************************

* Add Attributes

**********************************************/

conn->AddAttribute(TD_USER_NAME,user_name);

conn->AddAttribute(TD_USER_PASSWORD,user_password);

conn->AddAttribute(TD_TARGET_TABLE,target_table);

conn->AddAttribute(TD_TDP_ID,tdp_id);

/**********************************************

* Add Schema

**********************************************/

Schema * schema = new Schema("input");

schema->AddColumn("Associate_Id",TD_INTEGER,4);

schema->AddColumn("Associate_Name",TD_CHAR,25);

schema->AddColumn("Martial_Status",TD_CHAR,1);

conn->AddSchema(schema);

/**********************************************

* Add DMLGroups

**********************************************/

TD_Index dmlGroupIndex = 0;

DMLGroup* dmlGr = new DMLGroup();

dmlGr->AddStatement(dml_statment);

conn->AddDMLGroup(dmlGr,&dmlGroupIndex);

/**********************************************

* Initiate

**********************************************/

returnValue = conn->Initiate();

The Initiate function is returning with error saying

Driver Initiated with status 224

Error occurred during Initiate

**** 13:45:08 CLI '224' occurred while connecting to the RDBMS

Type: 2

PutRow failed on row 1 with status 224

Looking forward to get some quick response in this regard.

Thanks in advance

- Shiv
1 REPLY

Re: Need help for TPT API

Hi,

First you specify the database name in the configuration file i.e input.txt also see that the name of the database in is the hostfile (C:\WINDOWS\system32\drivers\etc\hosts ==> If you are using Windows or /etc/hosts ==> If you are using unix/linux). Hope this will answer your question.

Thanks,
Venkat