| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: basic plsql question
This procedure is better. You could use the translate function alone,
but the string parameters would make your code long and unwieldy.
create function word_fmt (word varchar2) return varchar2 is begin
return translate(word,
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9999999999'
);
if word_fmt('a52132') = 'X99999' then
.....
end if;
or
if translate(word, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX9999999999') =
'X99999' then
....
end if;
Received on Mon Aug 30 2004 - 14:36:11 CDT
![]() |
![]() |