Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: TRANSLATE function doesn't work correctly?
Michael Carmack wrote:
>
<snip>
>
> 1 select TRANSLATE(
> 2 '3EOX4KA7NVFJWPCS2GTH158DRLQYMGB9ZU0I',
> 3 '3EOX4KA7NVFJWPCS2GTH158DRLQYMGB9ZU0I',
> 4 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
> 5 ) "Decrypted String"
> 6* from dual
> SQL> /
>
> Decrypted String
> ------------------------------------
> ABCDEFGHIJKLMNOPQ3STUVWXYZ0123456789
> ^
> ^
>
> As you can see, the letter 'R' has not been correctly decrypted, i.e. the
> character '2' is not being translated back into an 'R' as specified in the
> statement.
I'm guessing it's because you have G twice in the 'from' string. I replaced the second G with a 6 (maybe you had a typo?) and it works fine.
SQL>
SQL> select
2 translate ('3EOX4KA7NVFJWPCS2GTH158DRLQYM6B9ZU0I',
3 '3EOX4KA7NVFJWPCS2GTH158DRLQYM6B9ZU0I', second G changed to a 6 ^ 4 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890') 5 as "Decrypted String"
Decrypted String
^ no anomaly -- ___ ___ (___)=============================================================(___) | | Jacques Raymond Kilchoer MIS:Applications Support | | | | Assistant DBA /^\ ^ (714) 729-4500 x3733 | | | | Cost Care, Inc. /\ _/ \/ \ fax 729-4651 | | | | Newport Beach /\ /\/ \// \ \_/\ | | | | CA 92660 / \ / / \ / \ Suisse/Schweizer | | |___| ____/____\____/_________\___ _\_______ Svizzero |___| (___)=============================================================(___)Received on Wed Jun 11 1997 - 00:00:00 CDT
![]() |
![]() |