473,387 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Case INsensitivity for string comparisons

Tom
Hi,

Our development team is adding DB2 8.1 compatibility to our existing
application which currently supports SQLServer 2000. Our code is
written to take advantage of SQLServer's ability to allow query
string compares to be case insensitive. We have identified DB2 forces
all query string compares to be evaluated case sensitive. Since our
code is written to assume case insensitivity, it curently seems that
we must change our code base to force each compare to be case
insensitive in order to be compatible with DB2.

We are looking for a configuration option or similar mechanism for DB2
8.1 to allow for all query string compares to be case insensitive by
default. This is to allow us to avoid making any changes in our code
to compensate for the case sensitive nature of DB2 string compares.

Specifically: what we are looking for is a way that the code:

WHERE lastname = UPPER('Geyer')

can be coded as

WHERE lastname ='Geyer'

and any combination of case in the data that = 'geyer' would match.

1. Does DB2 8.1 have a mechanism for changing all query string
compares to be case insensitive?

2. If not, what is the recommended technique for performing case
insensitive string compares in DB2?

3. If not, does IBM have plans to enable case insensitive string
compares in DB2 in an upcoming release?
Thanx much,

Tom
Nov 12 '05 #1
2 10287
v8.1 has workarounds with views and generated columns (including index
support) described here:

http://www-106.ibm.com/developerwork...3adamache.html

Tom wrote:
Hi,

Our development team is adding DB2 8.1 compatibility to our existing
application which currently supports SQLServer 2000. Our code is
written to take advantage of SQLServer's ability to allow query
string compares to be case insensitive. We have identified DB2 forces
all query string compares to be evaluated case sensitive. Since our
code is written to assume case insensitivity, it curently seems that
we must change our code base to force each compare to be case
insensitive in order to be compatible with DB2.

We are looking for a configuration option or similar mechanism for DB2
8.1 to allow for all query string compares to be case insensitive by
default. This is to allow us to avoid making any changes in our code
to compensate for the case sensitive nature of DB2 string compares.

Specifically: what we are looking for is a way that the code:

WHERE lastname = UPPER('Geyer')

can be coded as

WHERE lastname ='Geyer'

and any combination of case in the data that = 'geyer' would match.

1. Does DB2 8.1 have a mechanism for changing all query string
compares to be case insensitive?

2. If not, what is the recommended technique for performing case
insensitive string compares in DB2?

3. If not, does IBM have plans to enable case insensitive string
compares in DB2 in an upcoming release?
Thanx much,

Tom


Nov 12 '05 #2
Other solutions may include ...

If your app uses it's own database, maybe you can create one using a user
defined collating sequence.
(or find a system collating sequence that is case insensitive?)

Maybe there is also something to do with COLLATING_SEQUENCE option of the
federated features of db2.
(never been there... federating db2 to db2)
Function mapping?

I suggest you also read :
http://publib.boulder.ibm.com/infoce...help/index.jsp
search : "LIKE predicate applied to a CHAR column"
Just to show you that like predicates may behave differently. (db2 vs sql
server)

As for your Q3, i doubt ibm will ever default to
orange = apple or 'a' = 'A'
UCASE and other text functions are there to support users who wish
to deviate from the default.

Maybe there are other solutions available.
Is the app using java, odbc, ... ?

PM

"Tom" <tm*****@gr.com> a écrit dans le message de
news:bb**************************@posting.google.c om...
Hi,

Our development team is adding DB2 8.1 compatibility to our existing
application which currently supports SQLServer 2000. Our code is
written to take advantage of SQLServer's ability to allow query
string compares to be case insensitive. We have identified DB2 forces
all query string compares to be evaluated case sensitive. Since our
code is written to assume case insensitivity, it curently seems that
we must change our code base to force each compare to be case
insensitive in order to be compatible with DB2.

We are looking for a configuration option or similar mechanism for DB2
8.1 to allow for all query string compares to be case insensitive by
default. This is to allow us to avoid making any changes in our code
to compensate for the case sensitive nature of DB2 string compares.

Specifically: what we are looking for is a way that the code:

WHERE lastname = UPPER('Geyer')

can be coded as

WHERE lastname ='Geyer'

and any combination of case in the data that = 'geyer' would match.

1. Does DB2 8.1 have a mechanism for changing all query string
compares to be case insensitive?

2. If not, what is the recommended technique for performing case
insensitive string compares in DB2?

3. If not, does IBM have plans to enable case insensitive string
compares in DB2 in an upcoming release?
Thanx much,

Tom

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some...
1
by: D. Alvarado | last post by:
Hello, I'm sure this is a pretty easy question, but how would I indnicate in my XML schema that I wanted to make attribute name comparisons case insensitive? For example, is I had an element ...
5
by: bjorgenson | last post by:
I have a SQL 2000 database. I have a ASP.NET web app that I use to search this database. I need to make my data case insensitive, espcially my last name column. How do I change this? Thanks,...
6
by: crosser | last post by:
I have class written in C# with elements: 1. Private variable: aaa 2. Protected overridable property AAA the only differrence in names is case sensitivity. Is it possible to shadow...
3
by: UMPA Development | last post by:
Hello all! Is it possible to setup a group by to be case insensitive and if so how? Thank you! ---------------------------(end of broadcast)--------------------------- TIP 8: explain...
15
by: gregory_may | last post by:
Is there any options in VS 2005 to better handle case issues in C# (Similar to VB.Net)?
4
by: Mark Rae | last post by:
Hi, Is it possible to create a case-insensitive List<stringcollection? E.g. List<stringMyList = new List<string>; MyList.Add("MyString"); So that:
12
by: Merk | last post by:
What are some alternatives to using .ToUpper() to perform case insensitive string comparisons? The reason I'm asking is that I'm comparing strings in a long loop, looking for equality; and I...
1
by: Matt | last post by:
I have to believe I'm not the first person to have this question. However, I'm not having any luck finding an answer. I'm using Java 1.5. Say I have the following: Set<Stringa = new...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.