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

From: Larry Leonard <Spam_at_DefinitiveSolutions.com>
Date: 4 Feb 2003 05:15:31 -0800
Message-ID: <27270a53.0302040515.1667e314_at_posting.google.com>



[Quoted] [Quoted] I have a table called PRICING_LEVEL, which also has a column called [Quoted] [Quoted] 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. Received on Tue Feb 04 2003 - 14:15:31 CET

Original text of this message