473,796 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10314
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_SEQUE NCE 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.goo gle.com...
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
3167
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 sort? Thanks, Elliot
1
2932
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 <MYELEMENT myattr="1"> I would want the "myattr" attribute to validate against <xs:schema name="MYATTR" type="xs:integer"/>
5
1291
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, Brian
6
1666
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 variable aaa in inherited class using Visual Basic ? I can't find a solution because of Visual Basic case insensitivity...
3
4840
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 analyze is your friend
15
1567
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
23971
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
2846
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 want for this loop to run as fast as possible. So I'm looking for a method that would be faster than .ToUpper(). Thanks!
1
29287
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 HashSet<String>(); Map<String, Objectb = new TreeMap<String, Object>(); Assume somewhere these are populated.
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10452
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5569
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.