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 -> Best way to parse strings in PL/SQL

Best way to parse strings in PL/SQL

From: David Sisk <davesisk_at_ipass.net>
Date: 2000/04/24
Message-ID: <1x5N4.53$c71.304@saturn.ipass.net>#1/1

I've got a big batch of ascii data coming in via the UTL_HTTP package. It's pretty slick for getting the data, but man is it ugly to try to get it into columns. The majority of it is comma delimited values, but then there's some lines that are different (such as comma delimited column headers, plus some header data that is not comma delimited). Each line has a CRLF character behind it. Finally, this may be 10K or more of data, but it's split into 2K chunks, which does not necessarily split it where the CRLF's are. Some of the numeric values include fractions rather than decimal numbers.

I want to take the first two lines (meaning lines ending with a CRLF) and seperate the string into data to go into columns in one table, then take the remaining lines and seperate those into data to go into columns in a second table. Essentially, take this ugly bunch o' stuff and insert it neatly into the necessary table columns.

I'm a competent DBA, but not an expert PL/SQL developer. So, using PL/SQL, does anyone have any recommendation on the best way to do this task? Any functions that might prove very useful, etc.?

Best regards,

--
David C. Sisk
Need tech info on Oracle? Visit The Unofficial ORACLE on NT site at
http://www.ipass.net/~davesisk/oont.htm
Like original modern rock?  Listen to song samples and buy a CD at
http://www.mp3.com/disparityofcult
Raleigh music compilation!  All $$$ go to NC Food Bank.
http://www.mp3.com/whisper2ascream
Received on Mon Apr 24 2000 - 00:00:00 CDT

Original text of this message

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