Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Accessing multiple Databases with Class::DBI

by derby (Abbot)
on Jan 21, 2004 at 13:30 UTC ( [id://322870]=note: print w/replies, xml ) Need Help??


in reply to Accessing multiple Databases with Class::DBI

I'd have to test this out but isn't Class::DBI usually used in a module-2-table manner? If so, you could have something like this:

package MyModule::DBI; use base 'Class::DBI'; MyModule::DBI->set_db(...); ... package MyModule::Table; use base 'MyModule::DBI'; MyModule::Table->table('table'); ... package MyModule::DB2_Table; use base 'MyModule::DBI'; MyModule::DB2_Table->table( 'db2.table' ); # that should work depending on the security # and access restrictions .... my @db1_data = MyModule::Table->search( field => 'value' ); my @db2_data = MyModule::DB2_Table->search( field => 'value' ); ...

But then again, it's these types of situations that make me steer away from Class::DBI.

-derby

Replies are listed 'Best First'.
Re: Re: Accessing multiple Databases with Class::DBI
by !unlike (Beadle) on Jan 21, 2004 at 13:54 UTC

    Silly me! Of course.

    I really must remember to take off my dunce hat!

    !unlike

    I write my Perl code like how I like my sex: fast and dirty. ;)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://322870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 06:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found