As an alternative to this, any user has the privilege to define an alias for
any of the table one has access to.
db2 connect to <dbname> user bill using somepw
db2 select * from db2inst1.authors ==> This works
db2 create alias bill.myauthors for db2inst1.authors
db2 select * from myauthors ==> This will also work
The alias is: bill.myauthors and is valis as long as no other object in the
db is called bill.myauthors. (Note that the alias could also be
bill.authors as no other object is called bill.authors).
Your users then do not have to remember to set the current schema.
HTH, Pierre.
"Anton Versteeg" <an************@nnll.iibbmm.com> a écrit dans le message de
news:40**************@nnll.iibbmm.com...
First issue: set current schema = 'DB2INST1'
James Foreman wrote:
We have 5 users of our database (DB2 UDB 8.1 on SuSE linux) :
db2inst1
bill
fred
sarah
jessica
The tables are created under db2inst1, which has the ability to
drop/create/alter/etc. bill, fred, sarah and jessica all have select
privileges on some of these tables.
If I go into the CLP and connect as db2inst1, I can write
SELECT * FROM authors
and get results back. If I connect as bill, then
SELECT * FROM authors
gives SQL0204N "BILL.AUTHORS" is an undefined name.
whereas
SELECT * from db2inst1.authors
executes correctly. To save my users having to refer to the schema
every time they mention a table name, is there a way to set the schema
in the CLP session to default to db2inst1 rather than
bill/fred/sarah/jessica?
--
Anton Versteeg
IBM Certified DB2 Specialist
IBM Netherlands