Re: Re: DB: Changing database during script execution
| From: | Tomas V.V.Cox | Date: | Mon, 22 Jul 2002 18:32:43 +0000 |
| Subject: | Re: Re: DB: Changing database during script execution | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7873@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
>
> > -----Original Message-----
> > From: Martin Jansen [mailto:mail@martin-jansen.de]
> > Sent: Monday, July 22, 2002 7:36 PM
> > To: Tomas V.V.Cox
> > Cc: smith@dybnet.de; pear-dev@lists.php.net
> > Subject: Re: [PEAR-DEV] Re: DB: Changing database during
> > script execution
> >
> >
> > On Mon Jul 22, 2002 at 06:4348PM +0200, Tomas V.V.Cox wrote:
> > > Lukas Smith wrote:
> > > > MDB has setDatase($dbname)
> > > > This method returns the old method and sets the database
> > to $dbname.
> > >
> > > Yeah, which basically does a disconnect() and connect(), the same I
> > > propossed to Martin (note that I'm talking about the drivers in
> > > general not MySQL specificly).
> >
> > Agreed. But your solution isn't that elegant than having a
> > method that can change the database name. (Of course having
> > such a method does only make sense if it can be done with all
> > supported DBMS, as I already pointed out in an earlier mail.)
> >
>
> Well I dont know all Metabase drivers.
> But knowing Manuel he would not have put this method into his common
> Metabase class if it weren't supported by all the RDBMS that Metabase
> supports :-)
>
Is more a matter of the PHP support (or the backend API) that has the
restriction of setting the database at connection time (Postgres,
Oracle, Informix, ODBC, Interbase). In all that drivers the only way for
switching the database is closing and reopening the connection.
Tomas V.V.Cox