String manipulation.....very Urgent!!!!!
Hello All,
In my sql query I have a querystring which is used in the similar query
select Name from MyTable where Name like 'querystring'
In Sybase database the querystring is case sensitive and if the querystring is 'sat%ed', I get all the results with sat...ed... NOT with Sat...Ed or sAt....edor SaT....eD or saT.... etc etc( I mean all the possible combinations). Can someone help me out with the string manupulation in java where in I can change the querystring in such a way that I can all the results(case insensitive) when I run my query. If there is some other way to accomplish this please help me out.
Thanks & Regards,
Sarada.
[683 byte] By [
sarada_lr] at [2007-9-27 18:58:24]

Trying out all possibilities is a very bad solution!!!
Converting all queries in a proper format, would be better.
For example the first letter is always upper case.
"myQuery" -> "Myquery"
"myquery" -> "Myquery"
"MYQUERY" -> "Myquery"
Your method would ensure the string has a proper format and send that query.
Just a suggestion, I have not a great experience with databases.
Hope it helps.
DOMO at 2007-7-6 20:59:20 >

If your application only uses the Sybase DBMS, it would seem to me that searching for a Sybase function would be the a good way to solve the issue. It has been a while since I last worked with a Sybase DBMS, but you may want to check for a list of available Sybase functions which may solve your issue.
sgh3 at 2007-7-6 20:59:20 >

> select stuff from tablename where uppercase(name) like
> 'SAT%ED';
And if you do this (as you pretty much must), you need to make sure that your table has an index on the uppercased name as well. In oracle, you'd do this by creating an index on "uppercase(name)" (instead of just "name"). Otherwise, the "uppercase(name) like 'SAT%ED'" will not use any indexes..