[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dbi-users
Subject:    RE: Guidance on setting up multiple database handles to be used in one script
From:       "Rutherdale, Will" <Will.Rutherdale () sciatl ! com>
Date:       2007-08-01 17:17:30
Message-ID: 7B8C821E108976489746D62B099CC397011398D9 () SACATOREXCH01 ! corp ! sa ! net
[Download RAW message or body]

It's not clear from your message what you want.

If you mean that you want to open a db handle or set of handles in the
same way with the same options across a number of scripts, why don't you
just create a function for that?  You can create your own Perl module
exporting that function and just call it from the different scripts.

If this doesn't solve your problem, then please specify what is needed.

-Will


> -----Original Message-----
> From: Russ [mailto:kropporama@gmail.com] 
> Sent: Tuesday 31 July 2007 21:21
> To: dbi-users@perl.org
> Subject: Guidance on setting up multiple database handles to 
> be used in one script
> 
> 
> Over time the need to connect to the same database in different
> scripts became apparent.  To do this I began by creating a package
> that contained all the $dbh handles (not advisable) as if one fails
> then your whole script is no good.   So I then split them into
> individual packages for each connect handler.  Again not good if you
> need to connect to multiple databases in your script, but aren't
> dependent on all of them having to work.
> 
> So is there a good way to manage database connections only.  So that
> multiple scripts can use the same connection  but it is defined in the
> one place.  Should I explore DBI::Ingres.  or is there another easier
> way, other than defining the connection in each script I create.
> 



     - - - - - Appended by Scientific Atlanta, a Cisco company - - - - -         
This e-mail and any attachments may contain information which is confidential, 
proprietary, privileged or otherwise protected by law. The information is solely 
intended for the named addressee (or a person responsible for delivering it to 
the addressee). If you are not the intended recipient of this message, you are 
not authorized to read, print, retain, copy or disseminate this message or any 
part of it. If you have received this e-mail in error, please notify the sender 
immediately by return e-mail and delete it from your computer.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic