Skip to Content.
Sympa Menu

freetds - [freetds] SQLPutData error

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: <brazilchina AT mail.goo.ne.jp>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] SQLPutData error
  • Date: 10 Mar 2004 16:23:18 +0900

Hi

I have failed to insert data with below program.
Do i use "SQLPutData" invalidly ?

I'm developing on these environment
-turbolinux workstation 8
-FreeTDS 0.62.1
-unixODBC 2.2.7
-SQL Server 2000

please help me.

source: -------------------------------
int rc;

SWORD nId;
SDWORD strLen = 0;
PTR pToken;

SDWORD cbName;

rc = SQLPrepare( hstmt, "INSERT INTO TEST_TABLE1 (ID, NAME) VALUES (?, ?)",
SQL_NTS);
if( rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO ){
SQLBindParameter(hstmt,
1,
SQL_PARAM_INPUT,
SQL_C_SSHORT,
SQL_SMALLINT,
0,
0,
&nId,
0,
&strLen);
SQLBindParameter(hstmt,
2,
SQL_PARAM_INPUT,
SQL_C_CHAR,
SQL_VARCHAR,
50,
0,
(PTR)2,
0,
&cbName);

cbName = SQL_LEN_DATA_AT_EXEC(0);
nId = 123;
rc = SQLExecute( hstmt );
while( rc == SQL_NEED_DATA ){
rc = SQLParamData( hstmt, &pToken );

if( rc == SQL_NEED_DATA ){
SQLPutData( hstmt, "abc", 3);
}
}
}

error message: -------------------------
Assertion failed: curcol->column_cur_size < curcol->column_size, file
prepare_query.c, line 510
Abort (core dumped)




Archive powered by MHonArc 2.6.24.

Top of Page