The situation that you describe raises a few questions:
-
If new tables are created every time this script is run, how does the script come up with a set of distinct names for each new set of tables?
-
How much data is the script loading into each new set of tables?
-
Is this database "write only", or is there some other process that reads from all these tables that are being created? How does the querier manage all those tables? How does it decide which set of tables to query on a given occasion?
-
What if the querier wants to integrate data across two or more runs of the table-creator script? How can you combine data from different runs if they are in many distinct, unrelated sets of tables?
-
Assuming that each set of newly created tables is identical every previously-created set (except for having different names assigned to the tables), wouldn't it be better to have a single set of tables, which this script would simply re-use (add to) on every run?
Regarding that last item, it would seem easy enough to take whatever method you are using at present to invent distinct table names, and instead have a single set of tables where that extra chunk of information is stored into the rows that are created on a given run. In other words, instead of this:
run1_tbla: (fld1, fld2, fld3, ...)
run1_tblb: (fldx, fldy, fldz, ...)
run2_tbla: (fld1, fld2, fld3, ...)
run2_tblb: ...
You could just have this:
table_a (run_id, fld1, fld2, fld3, ...)
table_b (run_id, fldx, fldy, fldz, ...)
Maybe "run_id" could be something like the date/time of the run, or whatever.
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.