Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to translate encoded emails like this U29ycnksIE
Email decoder v1
create or replace function translate_email
(email varchar2)
return varchar2
is
first_char number;
translated_message varchar2(4000);
begin
first_char := mod(ascii(substr(email,1,1)),10);
if first_char = 0
then
translated_message := 'Hallo, what is dual?';
elsif first_char = 1
then
translated_message := 'Go away you silly man';
elsif first_char = 2
then
translated_message := 'Now is the sql of our
disconent';
elsif first_char = 3
then
translated_message := 'Your mother was a hamster
and your father smelt of elderberries!';
elsif first_char = 4
then
translated_message := 'To 10046 or not to 10046.
That is the question';
elsif first_char = 5
then
translated_message := 'It was a dark and stormy
night';
elsif first_char = 6
then
translated_message := 'SSDD...Same SQL Different
Database';
elsif first_char = 7
then
translated_message := 'Always look on the bright
side of life';
elsif first_char = 8
then
translated_message := 'BEANS!';
elsif first_char = 9
then
translated_message := 'BURMA!...Sorry, I
panicked';
end if;
return translated_message;
end;
/