Page 1 of 1

case insensitive searching

Posted: Fri 12 Sep 2008 14:25
by csadler
Hi

Oracle 10g, C# 3.5

I'm trying to set case insensitive searches base on what I have found on the web and tested in toad:

_command = new OracleCommand("", _connection);
_command.CommandText = "alter session set nls_comp = ANSI";
_command.ExecuteNonQuery();
_command.CommandText = "alter session set nls_sort = BINARY_CI";
_command.ExecuteNonQuery();

This does not seem to work.

Any pointers would really be appreciated!

Thanks

Chris

Posted: Mon 15 Sep 2008 11:02
by Shalex
Please refer to the SQL documentation. We don't support such functionality.

is this still the case in v5.70?

Posted: Fri 05 Aug 2011 19:59
by slaxman
we would like to change the NLS_COMP and NLS_SORT settings at session level? do you have an API support in v5.70? if not, can we prepend the setting change scripts as part of the same connection simulating a session level change?

Posted: Mon 08 Aug 2011 16:07
by Shalex
We do not provide API for changing NLS_COMP and NLS_SORT. Try setting these initial parameters at the session level via OracleCommand. Be aware that Direct mode does not support NLS conversion on client side.

Posted: Tue 09 Aug 2011 11:44
by gustavp
Wouldn't it be easier to create a functional index in your DB (not even required, but faster for searching), and use the UPPER() function in you query?

some pseudo code to explain:
string somestring = "somestring";
string query = "select * from sometable where upper(somecolumn) = :bind";
Bindings bind = db.bind(":bind",somestring.ToUpper());
db.prepare(query, bind);
ResultSet restult = db.select();