LIKE operator on CHAR column when there is no wildcard character

From: Veeru71 <m_adavi_at_hotmail.com>
Date: Sat, 5 Jul 2008 23:59:04 -0700 (PDT)
Message-ID: <df183ca6-bbc9-4569-b4c8-5b9287cbe365@f36g2000hsa.googlegroups.com>


We are trying to upgrade our database from Oracle 9i to 10g.

We have a CHAR(30) column in a table.

When we perform string comparisons using '=' operator (Eg.....where col = 'XYZ' ) the trailing spaces are ignored, which is perfectly fine (both in 9i & 10g).

When we use LIKE operator without specifying any wildcard char in Oracle 9i (Eg.....where col like 'XYZ'), the trailing spaces are being ignored and so the behavior of "LIKE without wildcard char" is identical to direct '=' operator. But in 10g, the trailing spaces in the column value are making a difference.

I know that it doesn't make much sense to use LIKE operator when there is no wildcard char but the SQL is dynamically generated based on some complex conditions in the app.

So my question is what is the expected behaviour of LIKE operator on CHAR column with regard to trailing spaces when there is no wildcar character?

Is it possible to simulate 9i behavior in 10g by setting any config param ?

Thanks
Murty Received on Sun Jul 06 2008 - 01:59:04 CDT

Original text of this message