954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Oracle11g case sensitivity problem

Hi,

Im using Oracle 11g, and i have a query like

select * from test where ID_PRIVILEGES = 'ADMIN';

but in database ID_PRIVILEGES is stored as Admin, I want case insensitive search to be done. I cannot change my query as

select * from test where ID_PRIVILEGES = 'Admin';

Can anyone please help.

divyakprabh
Light Poster
40 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

I used to convert things in upper case while comparing strings in oracle

select * from test where upper(ID_PRIVILEGES) = upper('Admin');

You may also follow this link http://geekzspot.blogspot.com/2010/01/case-insensitive-oracle-database.html

urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
 

Thanks a lot for ur reply,

if i execute this command, ALTER SYSTEM SET NLS_COMP=LINGUISTIC SCOPE SPFILE;

i get,[SQL] ALTER SYSTEM SET NLS_COMP=LINGUISTIC SCOPE SPFILE
[Err] ORA-00927: missing equal sign


should i give the path of SPFILE in this statement.?

divyakprabh
Light Poster
40 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

I am not sure about the command, but you may have noticed this line in that link

Your client tool may be overriding your carefully set NLS Parameters. For example, in SQL Developer and JDeveloper (Tools -> Preferences… -> Database -> NLS Parameters)

Check the database parameters:

select * from nls_session_parameters;

This could also help

ALTER session SET NLS_COMP=LINGUISTIC 
ALTER session SET NLS_SORT=BINARY_AI
urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
 

Thanks a lot, it worked fine when i directly executed the query in navicat, but from my java application it still returning null.

divyakprabh
Light Poster
40 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

I think when you connect in java, you must always run this two query before doing anything, because change is applicable to session only. TO CHANGE IT PERMANANTELY YOU MUST HAVE SYSTEM USER ACCSESS

urtrivedi
Nearly a Posting Virtuoso
1,306 posts since Dec 2008
Reputation Points: 257
Solved Threads: 270
 

i have included these two statements in init.ora,

ALTER SYSTEM SET NLS_COMP = "LINGUISTIC" SCOPE SPFILE;
ALTER SYSTEM SET NLS_SORT = "BINARY_CI" SCOPE SPFILE;

divyakprabh
Light Poster
40 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You