Tonkuma wrote:
"060618154449"
----------------------- Commands Entered -------------------------
VALUES DATE(TRANSLATE('20AB-CD-EF', '060618154449', 'ABCDEF'));
------------------------------------------------------------------
1
----------
2006-06-18
1 record(s) selected.
It is amazing what uses translate can be bent to. I like reversal for
small strings:
translate('ABCDEFGHIJKLMNOPQRSTUVWXYX', stringexpr,
'ZYXWVUTSRQPONMLKJIHGFEDCBA')
You can extend this easily to 62 characters (lower case + digits) and
with some care to 96 (all the printable characters), and with extreme
care to 256 (all the bit patterns). I don't know if it is even further
extendable when multibyte characters/code pages are in use.
You can use the idea in the middle of a string leaving the rest alone:
translate('ABCDEFGH', stringexpr, 'ABCEDFGH')
reverses the middle two characters of an 8 character string.