Connecting Tech Pros Worldwide Forums | Help | Site Map

To make table data case insensitive

Member
 
Join Date: Feb 2007
Posts: 36
#1: May 31 '07
Hi,
The table data in my database is set to be case sensitive.
How will i make it to case insensitive.

debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,511
#2: Jun 1 '07

re: To make table data case insensitive


Data in table is not case-sensitive, untill unless u want to to be by using some functions like UPPER or LOWER of some few other
.
If u r using any of those remove that and store data directly into the table.

But if your problem is different ,please do post back
chandu031's Avatar
Expert
 
Join Date: Mar 2007
Posts: 76
#3: Jun 1 '07

re: To make table data case insensitive


Quote:

Originally Posted by getmeidea

Hi,
The table data in my database is set to be case sensitive.
How will i make it to case insensitive.

Hi (getmeidea?),

I assume your requirement is something like this:
If say a value 'a' has gone in for a filed ,then a value 'A' should not go in .

Then one of the methods is to create a unique index on this field
Expand|Select|Wrap|Line Numbers
  1.  
  2. create unique index <index_name> on <table>(lower(<field>));
  3.  
  4.  
You can use either lower or upper, it doesnt matter. With this, if a value goes in , the same value cannot go in irrespective of the case. Ofcourse , to implement this you will have to identify all the varchar fields in your table and create seperate indexes on them.

If this is not your requirement, then please do let me know.
Member
 
Join Date: Feb 2007
Posts: 36
#4: Jun 13 '07

re: To make table data case insensitive


Quote:

Originally Posted by debasisdas

Data in table is not case-sensitive, untill unless u want to to be by using some functions like UPPER or LOWER of some few other
.
If u r using any of those remove that and store data directly into the table.

But if your problem is different ,please do post back

Hi,

Using upper() and lower() function is the not the proper solution i need. Because when i will be passing query from so many places in my front-end application. Hence i may have to take care of using this upper() and lower(). Instead if the database do the comparison ignoring the case, it will be more comfortable.

So let me know how to set that property in database.

Thanking you,
Dileep
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,511
#5: Jun 13 '07

re: To make table data case insensitive


either u need to store data using functions or retrive using functions to compare.
Reply