Ramprasad A Padmanabhan wrote:

> quick question
>
>    In my script  I need to connect to two  different databases How Can I
> do this
>
>   $dbh = DBI->connect( "DBI:mysql:database=$DBNAME1;host=$DBHOST","", ""
> )  or die "Can't connect to Mysql database: $DBI::errstr\n";
>
> .......
> .......
> .......
>
> # Now change the database
> $dbh->selectdb($DBNAME2)   # This function doesnot  exist
>
> Do I need to connect to mysql again inorder to select a different database

Is this that big a burden?  One of the major benefits of RDBMS is that a given
database encapsulates its content.  The same SQL engine may manage many
different databases, each with its own set of permission, ralational sructure,
etc.  It is only sensible that when you move from one to another, each
connection should be explicit.

AFAIK, there is no bar to having two simultaneous connections to different DBs
open through the same SQL engine, and that much better promotes interactivity.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to