Personal tools
You are here: Home DB2 DB2 UDB v9 How to make DB2 V9.5 Case-Insensitive
Navigation
Log in


Forgot your password?
 
Document Actions

How to make DB2 V9.5 Case-Insensitive

New capabilities with DB2 9.5 fixpack 1


Locale-aware Unicode collation algorithm-based collations were introduced in DB2 9.5 fixpack 1. These collations can be tailored to ignore case and/or accents. When a database is created with a collation that ignores case, all database operations become case insensitive. It is necessary to create a new Unicode database to use these collations.


COLLATE UCA500R1_LEN_S1 - Ignore Accents, Upper and Lower cases
COLLATE UCA500R1_LEN_S2 - Ignore Upper and Lower cases


To create a database with an English collation that is case insensitive, use the following statement:

db2 "CREATE DATABASE dbx USING CODESET UTF-8 TERRITORY BR COLLATE USING UCA500R1_LEN_S2"



Selecting from tables in this database ignores case.

db2 "SELECT lastname FROM employee"


LASTNAME
-----------------
abrams
Adams
allison
Alomar

  4 record(s) selected.


Case insensitivity applies to all operations in the database.

db2 "SELECT lastname FROM employee WHERE lastname LIKE 'AL%' ORDER BY lastname"


LASTNAME
-----------------
allison
Alomar

  2 record(s) selected.


Source: http://www.ibm.com/developerworks/db2/library/techarticle/0203adamache/0203adamache.htmll

Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls