Skip to Content.
Sympa Menu

freetds - [freetds] Specifying a 0 for the “StrLen_or_IndPtr” in the SQLBindParameter call is not working on AIX.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "shiv kumar" <shivblore2000 AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Specifying a 0 for the “StrLen_or_IndPtr” in the SQLBindParameter call is not working on AIX.
  • Date: Tue, 21 Nov 2006 20:35:56 +0530

Hi All,



Please find the simplified below code which is giving problem: In the code
if I replace the "ValSz_ind3 = 8;" to "ValSz_ind3 = 0;" then the
SQLExecute is returning the SQL_ERROR. Unfortunately after this if I call
"SQLGetDiagRec" it is returning a null empty string. The same code is
working well with the solaris and unix. I am using the uniXODBC
2.2.11version and hopefully I am not building it as 64-bit driver. I
have tried
with both FreeTDS0.63 and FreeTDS 0.64 version.

PLEASE HELP.



int spcall (char*)

{

int retcode;

long ValSz_ind1, ValSz_ind2, ValSz_ind3 = 0 ;

int p1 = 0, p2 = 1;

char p3[32];





retcode = SQLFreeStmt(hstmt1, SQL_CLOSE);

retcode = HandleError( hstmt1, 2, retcode);



retcode = SQLFreeStmt(hstmt1, SQL_UNBIND);

retcode = HandleError( hstmt1, 2, retcode);



retcode = SQLPrepare (hstmt1, (SQLCHAR *) "{ ? = CALL RPC_Read (
?, ? ) }" , SQL_NTS);

if(!HandleError(hstmt1, 2, retcode))

return 65302;



retcode = SQLBindParameter(hstmt1, 1, SQL_PARAM_OUTPUT /*
SQL_RETURN_VALUE */, SQL_C_LONG, SQL_INTEGER,

0, 0, (SQLPOINTER)&p1, 0,
&ValSz_ind1);

if(!HandleError(hstmt1, 2, retcode))

return 65302;



retcode = SQLBindParameter(hstmt1, 2, SQL_PARAM_INPUT /*
SQL_RETURN_VALUE */, SQL_C_LONG, SQL_INTEGER,

0, 0, (SQLPOINTER)&p2, 0,
&ValSz_ind2);

if(!HandleError(hstmt1, 2, retcode))

return 65302;



ValSz_ind3 = 8; // If I specify this a

retcode = SQLBindParameter(hstmt1, 3, SQL_PARAM_INPUT,
SQL_C_BINARY, SQL_VARBINARY,

8, 0 , p3, 8, &ValSz_ind3);

if(!HandleError(hstmt1, 2, retcode))

return 65302;



retcode = SQLExecute(hstmt1);

if(!HandleError(hstmt1, 2, retcode))

return 65302;



retcode = SQLFetch(hstmt1);

if(!HandleError(hstmt1, 2, retcode))

return 65302;



return 0;



}



  • [freetds] Specifying a 0 for the “StrLen_or_IndPtr” in the SQLBindParameter call is not working on AIX., shiv kumar, 11/21/2006

Archive powered by MHonArc 2.6.24.

Top of Page