-
into a table? I need some help in figuring out how to insert something like: 12, 23, 24, 78, ... which gets passed on to me into a table:
Column
---------
12
23
24
78
I would appreciate your coach. thanks!
-
zee,
If you are receiving this data as a string, and wish to insert each value separately into a table, you could create a stored procedure which takes the string as input, parses it and does the inserts.
I'll give you some code later tonight if you don't get it done. Let me know here.
-
Thanks Kmesser! I'll give it a shot...haven't found a way to parse it correctly yet so I would appreciate any tips.
-
Try this piece of code.
declare
str varchar2(200) := '123,456,789,90000,1,2,3,5,78,90,' ;
stpos number := 1;
endpos number ;
begin
for i in 1..length(translate(str,',0123456789',','))+1
loop
endpos := instr ( str ,',',stpos ) ;
dbms_output.put_line( substr( str,stpos,abs(endpos - stpos )) ) ;
stpos := endpos + 1 ;
end loop ;
end ;
-
It works! Thank you Victoria! I was playing with the substr and instr...but this code simple works great.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|