Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Relational databases and tied hashes?

Reply
Thread Tools

Relational databases and tied hashes?

 
 
Lee Goddard
Guest
Posts: n/a
 
      12-15-2004
At 2004-12-14 08:26:01 PST, Sherm Pendley ((E-Mail Removed))
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 ((E-Mail Removed))
added:

>Check for Tie:BI, 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
 
Reply With Quote
 
 
 
 
Alan Mead
Guest
Posts: n/a
 
      12-15-2004
Star date: Wed, 15 Dec 2004 01:59:54 -0800, Lee Goddard's log:

> At 2004-12-14 08:26:01 PST, Sherm Pendley ((E-Mail Removed))
> 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 ((E-Mail Removed))
> added:
>
>>Check for Tie:BI, 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 ...


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
 
Reply With Quote
 
 
 
 
Matija Papec
Guest
Posts: n/a
 
      12-17-2004
X-Ftn-To: Lee Goddard

http://www.velocityreviews.com/forums/(E-Mail Removed) (Lee Goddard) wrote:
>>Check for Tie:BI, 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.


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};


--
Matija
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
36 years of relational databases Lawrence D'Oliveiro NZ Computing 26 07-25-2006 10:55 AM
Xindice VS Relational Databases Eric Frigot XML 1 12-21-2004 02:01 AM
Relational databases and tied hashes? Lee Goddard Perl Misc 2 12-14-2004 04:46 PM
Re: Any pure-python relational databases? David McNab Python 2 07-14-2003 12:56 AM
Re: Any pure-python relational databases? Thomas Weholt Python 1 07-13-2003 02:06 AM



Advertisments