Dear kind neighbors, {sorry for cross posting}

Thanks in the past for your great help.   [I'm not a DB programmer, and
I have no help...whine whine..]

|||||| NT 4,svp 6, ASPerl build 629; DBI, PPM2.1.5, DBD::Oracle

MY Question(s):   { please note I did refer to Tim Bunce DBI Book,
Camel, Oracle8i book, etc.}
Q:

What is best way to assign a KEY index number to my header/data lines
INSIDE a Perl script? [see example below]

Moreover, how do I assign a KEY index inside Perl Script for each
"datafile" processed which extracts and puts 'headerinfo' from each file
into a HEADER table, and datalines (1..k associated with sequence number
J)  into the DATA table ? I hope this is clear, because my knowledge is
limited (smile).

I'm extracting data from hundreds of TEXT files. This I have done, but
not pumping the data using INSERTS into two TABLES after getting the
data from "ONE" text file. The example data below should help? I don't
know of a good strategy for assigning a KEY index to headers and
maintaining that "SEQUENCE" in a permanent ?file/process/text file?. I
wanted to do it all inside ORACLE after DBI pumps the lines to the
tables, but I may need to make the KEY assignment inside Perl script in
order to have a backup plan for extaction and loading (say, putting data
into MS ACCESS via DBD::ODBC or DBD::CSV).


I have data:

__Data__

headerForSampleJ, DateCollected
SampleDatemmyydd, ID1, ID2
blank
"=========="
dataline1
dataline2
....
....
datalinek
"==========="

__Stop Data__


CODE so far {spare you the details for now}:
----------------------------------------
#  get file name M
#  open() TEXT file J and get header -- assign KEY here (in chrono
sequence)
#     -get J's datalines and copy down KEY NUMBER for each row
#    -use a PIPE to make a permanent TEXT file to 'keep' a permanent set
of 'KEYS'?

#  pump header line into Oracle HEADER table
#  pump dataline into DATA table
#  close() everything

I don't include the code, because it got too big for the question on
this "strategy in Perl scripting". I know how to slurp data and Print
OUT, but this deal of keeping track of KEYS (when my program is batch)
confuses me?

Thanks again, and I'll post a summary for other newbies.

Steve Few
Statistician
NC DENR, Raleigh, NC
[EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to