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

Re: Best way to parse strings in PL/SQL

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/04/25
Message-ID: <39058E21.640A@yahoo.com>#1/1

David Sisk wrote:
>
> 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

Some useful bits and pieces in PL/SQL

INSTR
REPLACE
TRANSLATE
SUBSTR HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Tue Apr 25 2000 - 00:00:00 CDT

Original text of this message

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