Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: The Winner is ...

Re: The Winner is ...

From: Billy <123456781_at_ix.netcom.com>
Date: 1998/01/27
Message-ID: <34CE59D0.55850E2D@ix.netcom.com>#1/1

Pure Excellence!
Thanks,
Billy

Chrysalis wrote:

> You might like a slightly more compact version written as function which
> can be used in SQL statements (select, insert, update,etc):
> SQL> create or replace function num_x (instr varchar2)
> 2 return varchar2 as
> 3 otstr varchar2 (40);
> 4 begin
> 5 for i in 1 .. length(instr)
> 6 loop
> 7 if substr(instr,i,1) between '0' and '9' then
> 8 otstr := otstr||substr(instr,i,1);
> 9 end if;
> 10 end loop;
> 11 return otstr;
> 12 end num_x;
> 13 /
>
> Function created.
>
> SQL> show errors;
> No errors.
>
> SQL>
> SQL> col rslt format a12;
> SQL> select num_x('9871cb09 8!§i=987') rslt from dual;
>
> RSLT
> ------------
> 9871098987
>
> HTH
> --
> Chrysalis
>
> FABRICATI DIEM, PVNC
> ('To Protect and to Serve')
> Terry Pratchett : "Guards Guards"
Received on Tue Jan 27 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US