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

shiv kumar shivblore2000 at gmail.com
Tue Nov 21 15:03:54 GMT 2006


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.


PLEASE HELP.

Thanks a lot,
Shiva



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;



}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20061121/723fc2d2/attachment.html>


More information about the unixODBC-support mailing list