Re: Table and column with same name, fails only if using bind parameter

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Tue, 04 Feb 2003 08:26:41 -0800
Message-ID: <3E3FE9C1.23A175D0_at_exesolutions.com>


Larry Leonard wrote:

> I have a table called PRICING_LEVEL, which also has a column called
> PRICING_LEVEL. (No, I'm not the one that did this.)
>
> The problem is, while this correctly returns the one row I expect:
>
> SELECT description
> FROM pricing_level
> WHERE pricing_level.pricing_level = '41';
>
> ... this always incorrectly returns zero rows:
>
> SELECT description
> FROM pricing_level
> WHERE pricing_level.pricing_level = :p_price_lev;
>
> That is, when I use bind parameters, it fails to return the correct
> row; no error is generated. Interestingly, it fails using either a
> CRecordset-derived class (ODBC), or an ODynaset-derived class (oo4o).
>
> The workaround is, of course, to not use bind parameters for this
> particular query, but I'm wondering if anyone could help me understand
> exactly *why* this is failing. Obviously Oracle is getting confused
> (understandably) by the naming confusion, but I'm looking for a way to
> understand how and why. Any input is appreciated. TIA.

[Quoted] [Quoted] I doubt anyone can help you with WHY without access to the source code. And WHY isn't really important as ... it is. The solution is simple and straight forward ... choose it.

[Quoted] Though I would try changing ODBC drivers first to see if it is Oracle ... or the driver causing the problem.

Daniel Morgan Received on Tue Feb 04 2003 - 17:26:41 CET

Original text of this message