Unix Technical Forum

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

This is a discussion on pl/sql iterate through ext file dir of csv files & count unique records within the Oracle Miscellaneous forums, part of the Oracle Database category; --> can pl/sql iterate through an external to oracle csv file directory with pipe(|) field delimiters and count unique records ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 01:03 PM
cma
 
Posts: n/a
Default pl/sql iterate through ext file dir of csv files & count unique records

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 01:03 PM
DA Morgan
 
Posts: n/a
Default Re: pl/sql iterate through ext file dir of csv files & count uniquerecords

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@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com