Relational databases and tied hashes?

L

Lee Goddard

At 2004-12-14 08:26:01 PST, Sherm Pendley ([email protected])
wrote:
If you're thinking this would take three separate SQL queries, you can
...join

Thanks, that's true, but what I'm really looking for is a way to tie
multiple, linked tables to a hash.

And at 2004-12-14 08:50:03 PST, Matija Papec ([email protected])
added:
Check for Tie::DBI, it does even table updating for you

It does, but I can't find any info there on using it on tables related
by UID. I've been look at the author's Tie::RDBM too, but that rather
seems a misnoma - it doesn't seem to be so much a Relational DataBase
Manager, as a way of freezing and thawing perl data to a database.

I'm trying to use perl to dynamically create an RDB based upon an XSD
file, and then to parse SCORM Manifest XML on the fly, using the XML's
cross-referencing UIDs as related fields.

Does anyone out there have any ideas of another module that might
provide the underlying functionality? I don't much fancy writing a DB
Tie this close to the holidays with so much 'flu' around ...

Thanks
Lee
 
A

Alan Mead

Star date: Wed, 15 Dec 2004 01:59:54 -0800, Lee Goddard's log:
At 2004-12-14 08:26:01 PST, Sherm Pendley ([email protected])
wrote:


Thanks, that's true, but what I'm really looking for is a way to tie
multiple, linked tables to a hash.

And at 2004-12-14 08:50:03 PST, Matija Papec ([email protected])
added:


It does, but I can't find any info there on using it on tables related
by UID. I've been look at the author's Tie::RDBM too, but that rather
seems a misnoma - it doesn't seem to be so much a Relational DataBase
Manager, as a way of freezing and thawing perl data to a database.

I'm trying to use perl to dynamically create an RDB based upon an XSD
file, and then to parse SCORM Manifest XML on the fly, using the XML's
cross-referencing UIDs as related fields.

Does anyone out there have any ideas of another module that might
provide the underlying functionality? I don't much fancy writing a DB
Tie this close to the holidays with so much 'flu' around ...

Lee,

I cannot figure out precisely what you are trying to do. It seems like
this is really a reply where some key details were left off.

But it seems as if you're asking which PDA is right for Enterprise
Accounting... which wouldn't make sense. Similarly, hashes and RDB's
are just different things for different purposes.

My best guess about what you want is a special case of a set of SQL tables
where there are foreign key constraints and you want to pretend like the
tuples are in a single table. I think I can promise that no one has gone
to the trouble of making a solution for this constrained special case when
you can easily make the same functionality, plus much more, with standard
SQL.

One solution that's kind of like both is sqlite. If you haven't checked
it out, there are Perl bindings at www.sqlite.org and it runs on Windows
and Linux (among others).

If you are having trouble with SQL or DBI then I'm sure there are people
like myself here who can help.

-Alan
 
M

Matija Papec

X-Ftn-To: Lee Goddard

It does, but I can't find any info there on using it on tables related
by UID. I've been look at the author's Tie::RDBM too, but that rather
seems a misnoma - it doesn't seem to be so much a Relational DataBase
Manager, as a way of freezing and thawing perl data to a database.

Didn't try the Tie::RDBM but with first one you can tie hash with sql table
and retrieve $uid properties like,

my $name = $item{$uid}{name};
my $price = $item{$uid}{price};
my $image = $item{$uid}{image};
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top