Hicham BOUZDAD wrote:

> can i change a user  in a perl script using DBI.
> I explain :
> I want to do :
> 
> $dbh = connect(....'user1',....)
> ....
> change_user_to ( 'user2' );        ###########   like in Postgresql
> commande :        "  \c - user2 "
> $dbh -> do ('...');
> 
> this is because i want to have only ONE dbh  at each time.

This is database dependent. Which database system do you use?

I know the answer for these:

Oracle: alter session set current_schema=USER
MySQL:  use USER
Sybase: use USER

But be aware that this only changes the way how object names are
resolved (relative to the currently selected default schema), and
ensure, that the connected user has the rights to access the data of
this schema.

Joern

-- 
Joern Reder -- Software Development, dimedis GmbH, Koeln

Besuchen Sie uns vom 22.-28.03.01 auf der CeBIT, Halle 1, Stand 4c4
http://www.dimedis.de/terminvereinbarung

Reply via email to