hey all--

I'm working on some more DBI stuff and have kind of hit a wall. The stopping point is not perl, though, it's the way the databases I'm working with were set up. A brief explanation:

  • four fields: id, last_name, first_name, address
  • id is guaranteed to be unique, not guaranteed to be defined
  • last_name and first_name are guaranteed to be defined, but not to be unique
  • address is probably defined and is probably unique
  • the problem is that I have many different tables, and need to try to bring the information together, but cannot afford to match the wrong information with the wrong person. if I use the id field to identify and compare records across tables, I'll get correct matches but will not process all the records. if I use some combination of names and address, I risk incorrectly matching records where the names are the same and the addresses aren't defined.

    the first reply below is my implementation of a system that matches entries from different tables by id if possible, and if not, by names and address. (thought I should put it in a reply to keep it from cluttering the SOPW page).

    I guess I have three questions: 1) is there a better general strategy to deal with the problem? 2) is the code I have included an effective way of implementing the solution I've suggested, and 3) what suggestions should I make to the people that actually do the db design that might keep this sort of thing from happening with future tables that are created?

    if you feel that the real issue is simply a failure on my part to comprehend something basic and important, please include a link to someplace I can read up on it-- I'm fully aware of just how ignorant I may very well be, but not quite sure what I'm ignorant of! :D

    please do take a look at the code below,
    --au

    In reply to database strategy by aufrank

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.