|
Home > Archive > SQL Anywhere database > May 2005 > using different collation for REPLACE?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
using different collation for REPLACE?
|
|
| krisztian pinter 2005-05-23, 7:24 am |
|
hello,
we have a database with some collation that is case insensitive.
(i guess it is the collation that makes the database case insensitive)
we want to replace certain characters in procedure witht the REPLACE
function, but this time, we need a case sensitive replace. i could not
figure out any ways to temporarily alter the way ASA does string
comparison. it treats all lower and uppercase letters the same, plus,
it treats all accented characters the same. actually, i need exact
binary comparison. can anyone point me to the right direction?
thanks
| |
| Greg Fenton 2005-05-24, 3:23 am |
| krisztian pinter wrote:
>
> we have a database with some collation that is case insensitive.
> (i guess it is the collation that makes the database case insensitive)
Case sensitivity is set at database creation time ("dbinit" vs. "dbinit
-c").
What about using the "convert()" function? Here's a suggestion that
Mark Culp made to this newsgroup recently:
SELECT * FROM Inventory
WHERE serial = 'aBc'
AND convert(binary, serial) = 'aBc';
Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
| |
| krisztian pinter 2005-05-24, 7:23 am |
| thanks for answering. unfortunately, replace converts back to string,
so different letters still collate as one. i forsee a function with a
loop inside getting characters one by one and checking their ascii code.=
bye bye performance!
On 23 May 2005 18:48:28 -0700, Greg Fenton =
<greg. fenton_NOSPAM_@ianyw
here.com> wrote:
> What about using the "convert()" function? Here's a suggestion that =
> Mark Culp made to this newsgroup recently:
>
> SELECT * FROM Inventory
> WHERE serial =3D 'aBc'
> AND convert(binary, serial) =3D 'aBc';
| |
| Scott Holman 2005-05-24, 9:23 am |
| You could write an external function to perform the Replace.
"krisztian pinter" <pinterkr@freemail.hu> wrote in message
news:opsq94mhkrwwfeh
v@kar_wst_pint...
thanks for answering. unfortunately, replace converts back to string,
so different letters still collate as one. i forsee a function with a
loop inside getting characters one by one and checking their ascii code.
bye bye performance!
On 23 May 2005 18:48:28 -0700, Greg Fenton
<greg. fenton_NOSPAM_@ianyw
here.com> wrote:
> What about using the "convert()" function? Here's a suggestion that Mark
> Culp made to this newsgroup recently:
>
> SELECT * FROM Inventory
> WHERE serial = 'aBc'
> AND convert(binary, serial) = 'aBc';
|
|
|
|
|