I've been working in my spare time on an e-commerce site. I always try to dabble with something completely new in each project, and in this one, it was
Class::DBI. And it has been pretty cool and useful :) I've had significant enough success with it that I decided to start using Class::DBI for my projects at my Real Job. And that is where the "fun" started.
In my side-project, every one of my child tables is connected to its parent table by a single ID value. Unfortunately, I am not so lucky with my projects at work. To elaborate, our database tracks information about taxable property, and it tracks it by year. So our master table looks something like this:
parcel_year
-------------
parcel_number
parcel_year
...
parcel_number and parcel_year makes up the primary key for this table.
Our child tables then look like this:
site_address
------------
parcel_number
parcel_year
site_id
...
where parcel_number and parcel_year is a foreign key to our parcel_year table.
I've been over the POD for Class::DBI, super-searched the archives, and Googled for a while, but I haven't been able to find (or extrapolate what I need from what I've read) how to make Class::DBI's has_a() function inflate two columns to a single object. Has anyone done this? Is it possible? If so, how is it done?
Before someone offers the suggestion, it is not at all feasible to change the structure of the tables. It's been a consideration for future versions of our product, but it is simply not feasible or an option at this time.
Thanks for whatever help you can offer! :)
MrCromeDome
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.