dbTalk Databases Forums  

Help with statement and Schema - Newbie

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Help with statement and Schema - Newbie in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Les Block
 
Posts: n/a

Default Help with statement and Schema - Newbie - 10-20-2003 , 08:43 AM






I have just done an install on Windows XP.
Version 8.1 DB2 UDB (warehouse)

I have a talbe called VT08_Year
Column one is Char(3), Column Two is Char(6)
YearCode and Year Desc
A90, 1999
A95, 1999.5
B00, 2000
B10, 2001
B20, 2002

When I ran the script to create the table, I was logged onto the
computer as LESB with full administrator rights.

Now, this table resides in schema LESB - for the moment I don't know
how or why. But I've created another user SA, given them admin
rights, and rights to the LESB.VT08_Year Table. However, with an ADO
connect I cannot see this table with this query "SELECT * FROM
VT08_Year". I get an error stating that the server cannot find object
"SA.VT08_Year".

Can you help me understand what is happening here?
I am familiar with Oracle, and believe IBM Aliases are similar to
Oracle Synonyms but I don't want to have to create Aliases for all my
tables for the SA user. How is this solved?

Many thanks,
Les Block

Reply With Quote
  #2  
Old   
No Body
 
Posts: n/a

Default Re: Help with statement and Schema - Newbie - 10-20-2003 , 09:20 AM






Les Block wrote:

Quote:
I have just done an install on Windows XP.
Version 8.1 DB2 UDB (warehouse)

I have a talbe called VT08_Year
Column one is Char(3), Column Two is Char(6)
YearCode and Year Desc
A90, 1999
A95, 1999.5
B00, 2000
B10, 2001
B20, 2002

When I ran the script to create the table, I was logged onto the
computer as LESB with full administrator rights.

Now, this table resides in schema LESB - for the moment I don't know
how or why. But I've created another user SA, given them admin
rights, and rights to the LESB.VT08_Year Table. However, with an ADO
connect I cannot see this table with this query "SELECT * FROM
VT08_Year". I get an error stating that the server cannot find object
"SA.VT08_Year".

Can you help me understand what is happening here?
I am familiar with Oracle, and believe IBM Aliases are similar to
Oracle Synonyms but I don't want to have to create Aliases for all my
tables for the SA user. How is this solved?

Many thanks,
Les Block
You will need to qualify your query "select * from LESB.VT08_Year". If
you don't want to do that, you can set the default schema to LESB by
setting the "CURRENT SCHEMA" special register when you did the connect.



Reply With Quote
  #3  
Old   
Les Block
 
Posts: n/a

Default Re: Help with statement and Schema - Newbie - 10-21-2003 , 10:07 AM



Quote:
You will need to qualify your query "select * from LESB.VT08_Year". If
you don't want to do that, you can set the default schema to LESB by
setting the "CURRENT SCHEMA" special register when you did the connect.
Where is this "CURRENT SCHEMA" specail register and how do I set it?

If I were to use Aliases, does that mean that every user needs a
schema, in order to make aliases to the original schema? How do you
make many users have access to the same schema without having to make
schemas for each user and then making aliases? Is there a way to make
a group house the aliases, and then each user if part of the group. I
have a database with many tables, and 200 users, it seems a bit
peculiar that I would need to create 200 schemas for 200 users, and
then create all the aliases to the original schema?

Thanks for your response,
The whole schema thing is really baffling coming from an MS SQL server
background.

Les


Reply With Quote
  #4  
Old   
Ian
 
Posts: n/a

Default Re: Help with statement and Schema - Newbie - 10-21-2003 , 11:48 AM



Les Block wrote:
Quote:
You will need to qualify your query "select * from LESB.VT08_Year". If
you don't want to do that, you can set the default schema to LESB by
setting the "CURRENT SCHEMA" special register when you did the connect.


Where is this "CURRENT SCHEMA" specail register and how do I set it?
The statement: "set current schema lesb" would do it.

After executing this statement, any user executing the query
"select * from vt08_year" would read

Quote:
If I were to use Aliases, does that mean that every user needs a
schema, in order to make aliases to the original schema? How do you
make many users have access to the same schema without having to make
schemas for each user and then making aliases? Is there a way to make
a group house the aliases, and then each user if part of the group. I
have a database with many tables, and 200 users, it seems a bit
peculiar that I would need to create 200 schemas for 200 users, and
then create all the aliases to the original schema?
Yes. DB2 does not provide the concept of a public synonym (alias). So,
your options are:

1) Use fully qualified table names (select * from lesb.vt08_year)

2) Use "set current schema" immediately after your application connects
Note: you can also set this in the db2cli.ini file on the client
workstations.

3) Create aliases for all users.


Good luck,



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.