freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] Specifying a 0 for the "StrLen_or_IndPtr" in the SQLBindParameter call is not working on AIX.
- From: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] Specifying a 0 for the "StrLen_or_IndPtr" in the SQLBindParameter call is not working on AIX.
- Date: Tue, 21 Nov 2006 16:41:28 +0100
>
> 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;
>
>
>
> }
What are RPC_Read parameter types ??
freddy77
- Re: [freetds] Specifying a 0 for the "StrLen_or_IndPtr" in the SQLBindParameter call is not working on AIX., ZIGLIO, Frediano, VF-IT, 11/21/2006
Archive powered by MHonArc 2.6.24.