Re: [Sqlrelay-discussion] sqlrcur_inputBind not updating ODBC Param Number
Brought to you by:
mused
|
From: David M. <dav...@fi...> - 2009-02-26 15:45:56
|
When processing a bind variable, SQL Relay eventually calls the ODBC function SQLBindParameter(). SQLBindParamter() only allows you to specify which parameter to bind to by number, not by name. So when using ODBC, SQL Relay requires that you specify parameters by number, not by name. Other DB's have their own odd bind-variable naming restrictions too. I'll check the docs and make sure that the ODBC docs say that you have to use numbers. I'm actually surprised that the query worked, ODBC normally requires queries to have a ? for the parameter rather than colon-delimited. It could be that the TimesTen driver handles the colon-delimited format though. SQL Relay could potentially allow named parameters in the future. I could make it dig through the query, looking for colon-delimited parameters and map them to numbers. I'll put it on the TODO list. Dave dav...@fi... On Thu, 2009-02-26 at 14:34 +0000, jim watts wrote: > Hi > > > We are using sqlrelay 39.4 on RHEL5.2 x86_64 Linux to connect to > TimesTen 7.0.5 via unixODBC(2.2.11) on same system. > > > The language we are using is PHP. > > When sqlrcur_inputBind is called: > > > sqlrcur_prepareQuery($cur,"select rs_id, rs_group from > qlog.resources where rs_id = :resourceid"); > sqlrcur_inputBind($cur,"resourceid",'99903'); > > > The odbc trace file shows: > > > [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 > > > Since the Param Number = 0, and invalid parameter index is thrown. > > > > > > > > > When we change the php to call: > > > sqlrcur_prepareQuery($cur,"select rs_id, rs_group from > qlog.resources where rs_id = :resourceid"); > sqlrcur_inputBind($cur,"1",'99903'); > > > > > Where the sqlrcur_inputBind parameter is now the integer 1, the ODBC > trace shows Para Number = 1 and the query is processed by TimesTen. > > > > > Is this an error or bug that you may be aware of ? We have changed the > php calls but would like some clarification. > > > SQLRelay is used in other parts of the organisation and has proven to > be a reliable and excellent tool (so thanks for that). > > > Jim > > > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > __________________________________________________ > D O T E A S Y - "Join the web hosting revolution!" > http://www.doteasy.com > _______________________________________________ Sqlrelay-discussion mailing list Sql...@li... https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion __________________________________________________ D O T E A S Y - "Join the web hosting revolution!" http://www.doteasy.com __________________________________________________ D O T E A S Y - "Join the web hosting revolution!" http://www.doteasy.com |