Hello fellow Monks,
I have a problem which I have been mulling over for a couple of weeks now. The problem is to do with the correct order for loading data into a RDBMS from a data set extracted from another system...
1, I have a dataset (extracted from MSSQL Server) which contains two columns (only ever two columns) but several thousand records.
2, The data in the left column can be thought of as the "child", the data in the right can be thought of as the "parent"
3, If the two columns match then this piece of data is both parent and child and can be loaded at any time.
4, If the two are different then the child has a parent.
5, The parent can have many children, which means that this parent needs to be loaded before it's children.
6, It's possible for the parent to also be a child (child, parent, grandparent), which means the grandparent need to be loaded before the parent, which is before the child..
It's a conundrum. Basically I need to create a list of values in the correct order so that a "dependent" is always loaded after the parent otherwise the load simply will not work.
I was hoping that there would be a PERL module which would fit my requirements, or, some pretty smart work with arrays and/or hash's .
Any suggestions guys ??
SlackyB
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.