Ben: DB2 automatically takes the user ID you logged in with and uses that as your default schema.
You can issue the "SET SCHEMA" statement to change your default schema if you want it to be different from your DSN user ID. For example "SET SCHEMA rick" would automatically prepend 'rick.' to all of the tables, views, etc that you work with. Dan On Fri, 8 Oct 2004 12:40:20 -0400, Jeff Urlwin <[EMAIL PROTECTED]> wrote: > Ben, > > Please post these types of questions to the dbi-users list, rather than to me > directly. > There are a lot of other people with more experience than me with the various > databases > who can help. > > I believe that is standard behaviour for most ODBC drivers/logins, that if you l do > not > provide the schema, the login schema is presumed. With Oracle, for example, I can > get > around that with public synonyms. I'd check your DB2 documentation for that, because > DBD::ODBC itself shouldn't (isn't) automatically prepending the schema. That may be > happening in the driver or the database. > > Regards, > > Jeff > > -----Original Message----- > From: Ben Hui [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 07, 2004 6:03 PM > To: [EMAIL PROTECTED] > Subject: DBD::ODBC with DB2 > > I am having some problems connect 2 a DB2 DB using DBI::DBD > > suppose the DBname is db2a > > I connect to it using $user <sys> and $pass <mypass> > > the connection to the DB all OK > > DB2 does not separate the schema's between systems > > there are separate schema's with different prefixes > > ie > > parts > items > chdocs > > if I do a simple query like > > select product_name from product catalogue; > > I get an error because the user login is prefixed into the query > > select product_name from sys.product catalogue; > > that table doesnt exist. > > Is there a way to change prefix to somthing else?? It appears this is being passed > in from > the DSN > > ********************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. Any unauthorized review, use, disclosure or distribution is > prohibited. If > you are not the intended recipient, please contact the sender by reply e-mail and > destroy > all copies of the original message. > >