[unixODBC-support] SQLBindParameter : Invalid Parameter Index

jim watts jim.watts at gmail.com
Tue Feb 24 14:09:29 GMT 2009


Hi
Currently attempting the to use a bind parameter on RHEL x86_64 talking to
TimesTen 7.0.5 x86_64 using PHP 5.2.6 and SQLrelay 39.4.

php --> sqlrelay -- ODBC -> Times Ten.

The unixODBC (2.2.11) odbc.ini as follows:

[CUSTACC_CACHE]
Driver=/var/oracle/TimesTen/tt70/lib/libtten.so
DataStore=/var/oracle/TimesTen/tt70/info/CACC/CACC
DatabaseCharacterSet=WE8ISO8859P1
ConnectionCharacterSet=WE8ISO8859P1
Authenticate=0


With ODBC tracing on we receive this error:

[ODBC][21083][SQLPrepareW.c][300]
                Exit:[SQL_SUCCESS]
[ODBC][21083][SQLBindParameter.c][193]
                Entry:
                        Statement = 0x1d031740
                        Param Number = 0
                        Param Type = 1
                        C Type = -8 SQL_C_WCHAR
                        SQL Type = 1 SQL_CHAR
                        Col Def = 0
                        Scale = 0
                        Rgb Value = 0x1d19f360
                        Value Max = 10
                        StrLen Or Ind = (nil)
[ODBC][21083][SQLBindParameter.c][204]Error: 07009
[ODBC][21083][SQLError.c][342]
                Entry:
                        Statement = 0x1d031740
                        SQLState = 0x7fff8d66a170
                        Native = 0x7fff8d66a188
                        Message Text = 0x7fff8d669f70
                        Buffer Length = 500
                        Text Len Ptr = 0x7fff8d66a18e
[ODBC][21083][SQLError.c][379]
                Exit:[SQL_SUCCESS]
                        SQLState = 07009
                        Native = 0x7fff8d66a188 -> 0
                        Message Text = [[unixODBC][Driver Manager]Invalid
parameter index]





This issue has left me a little stumped, any help would be appreciated.




Below is the PHP code I use to attempt the bind:



<?php
echo "Connecting to SQLRelay\r\n";

 $con=sqlrcon_alloc("192.168.163.247",9000,"","user1","password1",0,1) or
die("Cannot Connect\r\n");
echo "Connected\r\n";
        $cur=sqlrcur_alloc($con);
        sqlrcur_prepareQuery($cur,"select rs_id, rs_group from
qlog.resources where rs_id = :resourceid");
        sqlrcur_inputBind($cur,"resourceid",'99903');
#       sqlrcur_validateBinds($cur) or die("binds are invalid -
".sqlrcur_errorMessage($cur));
        echo "Executing Query\r\n";
        sqlrcur_executeQuery($cur) or die ("Query Failed -
".sqlrcur_errorMessage($cur)."\r\n");
        for ($row=0; $row<sqlrcur_rowCount($cur); $row++) {
                     for ($col=0; $col<sqlrcur_colCount($cur); $col++) {
                             echo sqlrcur_getField($cur,$row,$col);
                             echo ",";
                     }
                     echo "\n";
        }

print_r($cur);

sqlrcur_free($cur);
sqlrcon_free($con);
?>
~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20090224/53845019/attachment.html>


More information about the unixODBC-support mailing list