Home » SQL & PL/SQL » SQL & PL/SQL » Parsing comma separated String
Parsing comma separated String [message #10812] Wed, 18 February 2004 09:17 Go to next message
Scion78
Messages: 15
Registered: February 2004
Junior Member
v_str := '62.3454,32.4565';
I want to split it at the ','
Any suggestions would be helpful
Re: Parsing comma separated String [message #10819 is a reply to message #10812] Wed, 18 February 2004 11:39 Go to previous messageGo to next message
sverch
Messages: 582
Registered: December 2000
Senior Member
SQL> declare
2
3 v_str varchar2(40):= '62.3454,32.4565';
4
5
6 begin
7
8 v_str:= REPLACE(v_str,'.',',');
9
10 DBMS_OUTPUT.PUT_LINE (V_STR);
11
12 END;
13 /

PL/SQL procedure successfully completed.

SQL> SET SERVEROUTPUT ON
SQL> /
62,3454,32,4565

PL/SQL procedure successfully completed.
Re: Parsing comma separated String [message #10870 is a reply to message #10812] Sat, 21 February 2004 05:32 Go to previous message
Sudhakar
Messages: 34
Registered: May 2002
Member
Hi,

select
substr('62.3454,32.4565',0,instr ('62.3454,32.4565',',')-1),
substr('62.3454,32.4565',instr ('62.3454,32.4565',',')+1) from dual

regards,
Sudhakar
Previous Topic: Show details of employee hiredates and the date of their first payday.
Next Topic: Last Rows
Goto Forum:
  


Current Time: Thu Apr 25 01:59:13 CDT 2024