Home » SQL & PL/SQL » SQL & PL/SQL » using replace function urgent
using replace function urgent [message #4319] Tue, 26 November 2002 20:51 Go to next message
Arfat
Messages: 25
Registered: August 2002
Junior Member
Hi
i have following values in a cloum called acno.
values r

abc1234567
1234567
xyz1234567
lmn1234567
7654321

The precisiong cahracter r not fixed.
means they migh come they might not
i want to write a query which will actully retrive only numeric values.

can any one help plz
Thanz in advance
Re: using replace function urgent [message #4325 is a reply to message #4319] Wed, 27 November 2002 00:03 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Some suggestion
You could create a function out of the following:
declare
  v_temp varchar2(250) := '&test';
begin
  for i in 1..127 loop
   IF i between 1 and 47
   OR i between 58 and 127
   THEN
     v_temp := replace(v_temp,chr(i),'');
   END IF;
  end loop;
  dbms_output.put_line('value is: '||v_temp);
end;

and call this function from SQL.

MHE
Previous Topic: updatable views
Next Topic: Replace function in select query
Goto Forum:
  


Current Time: Mon Apr 29 12:34:53 CDT 2024