Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: pl/sql iterate through ext file dir of csv files & count unique records

Re: pl/sql iterate through ext file dir of csv files & count unique records

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 18 Jun 2007 09:18:09 -0700
Message-ID: <1182183486.383415@bubbleator.drizzle.com>


cma wrote:
> can pl/sql iterate through an external to oracle csv file directory
> with pipe(|) field delimiters and count unique records based on fields
> 1,2,3,7,& substring data in field 8?
>
> record in file like...
> B12345|ramirez|jorge|m|x234||01/09/2006|text text1 text|
> B12345|ramirez|jorge|m|x231||01/09/2006|text text1 text|
> B12345|ramirez|jorge|m|x232||01/07/2006|text text text|
> B12345|ramirez|jorge|m|x233||01/09/2006|text text text|
>
> only fields 1,2,3,7 would be unique identifier... plus substring text1
> in field 10
>
> print file name, unique record count, and datestamp of file :
>
> filename1.csv..... 131,345 .....01/15/2006
> filename2.csv...... 29,020 ......03/08/2007
>
> ideally this would populate (insert) to a stat table
>
> thanks you

Yes. But set it up an an external table and just use SELECT COUNT(*). Never us PL/SQL to do what SQL can do.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon Jun 18 2007 - 11:18:09 CDT

Original text of this message

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