L
Lee Goddard
Is there a perl module to make life easier with relational,
linked databases?
For example, three tables, where each has a column acting as
a unique identifier (*.uid). The "item" table references the
"stock" table in the item.stock column using the stock.uid column;
the "item" table references the "image" table in the item.image
column using the item.uid column.
ITEM TABLE STOCK TABLE IMAGE TABLE
item.uid stock.uid image.uid
item.name stock.quantity image.href
item.price stock.others image.others
item.stock
item.image
I'd like a hash for every record I pull out of the "item" table,
and one that doesn't just give me the "item.stock" uid that is
there, but does the look-up and give me a hash of the relevant record:
$item->{
uid => 12,
name => "My Name",
price => '',
stock => {
uid => 103,
quantity=> 1,
others => 'other stuff',
},
image => {
uid => 43,
href => 'http://foobar/baz/121231.html',
others => 'some other stuff',
},
};
Since the perl world is full of great labour saving devices, it seems
natural that this one is out there somewhere - could you please tell
me if this is so, and if so, where? I've been looking on CPAN and
either found nothing or not undertood what I have seen....
Many thanks in anticipation
Lee
(I posted this to *.moderated too, but not sure it got there, thanks to IE)
linked databases?
For example, three tables, where each has a column acting as
a unique identifier (*.uid). The "item" table references the
"stock" table in the item.stock column using the stock.uid column;
the "item" table references the "image" table in the item.image
column using the item.uid column.
ITEM TABLE STOCK TABLE IMAGE TABLE
item.uid stock.uid image.uid
item.name stock.quantity image.href
item.price stock.others image.others
item.stock
item.image
I'd like a hash for every record I pull out of the "item" table,
and one that doesn't just give me the "item.stock" uid that is
there, but does the look-up and give me a hash of the relevant record:
$item->{
uid => 12,
name => "My Name",
price => '',
stock => {
uid => 103,
quantity=> 1,
others => 'other stuff',
},
image => {
uid => 43,
href => 'http://foobar/baz/121231.html',
others => 'some other stuff',
},
};
Since the perl world is full of great labour saving devices, it seems
natural that this one is out there somewhere - could you please tell
me if this is so, and if so, where? I've been looking on CPAN and
either found nothing or not undertood what I have seen....
Many thanks in anticipation
Lee
(I posted this to *.moderated too, but not sure it got there, thanks to IE)