If a large percentage of the 8000 or so records in SRCFILE
are going to end up as new data to be inserted into the table,
then you will
save A LOT of time by moving
those records into a separate plain text file that can be
"bulk-loaded" into the table by whatever means is provided
in your particulat DBMS (e.g. "sqlload" in Oracle, "mysqlimport"
or some such). Single-record-at-a-time inserts with DBI are
painfully slow compared to a native DBMS utility that is
already optimized for inserting/appending large quantities of data into
tables.
Follow the advice given in the first reply -- do one query at
the outset to find out what records are already in the table --
then open SRCFILE for input, open some other file for output,
and for each line of input, write a suitable data line to
output if the corresponding record needs to be added to the
table. After output file is fully written, run the bulk-loader utility
of choice for DBMS to add that data to the table (this can be
done from within the same perl script that writes the file).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.