By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,611 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,611 IT Pros & Developers. It's quick & easy.

what is a fully qualified table name in DB2 ?

P: n/a
Hi,

Generally we work with the 2 part qualified table names in db2 i.e.
<schema>. <table name>
Is there a more fully qualified table name ? I've seen that a select
from <database name>.<schema>.<tabnamealso works.

This brings me to the next question. Is it possible to refer to a
table in database 2 when connected to database 1 ? If so any
privileges that are required for doing that ?

Jun 20 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Vivek wrote:
Hi,

Generally we work with the 2 part qualified table names in db2 i.e.
<schema>. <table name>
Is there a more fully qualified table name ? I've seen that a select
from <database name>.<schema>.<tabnamealso works.
Yes, as long as the db name is the db the object resides in or the local
db alias in case of dynamic SQL. This is more syntax toleration than
feature.
This brings me to the next question. Is it possible to refer to a
table in database 2 when connected to database 1 ? If so any
privileges that are required for doing that ?
DB2's approach to federation is through NICKNAMEs. Nicknames are like
ALIASes to remote objects.
You need to set the FEDERATED option in the DBM CFG to ON.
There are numerous introductions to federation on DeveloperWorks.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 20 '07 #2

P: n/a
So i cannot refer to an object in another database (say database2) as

database2.<schema>.<tabname (when connected to database1)

even though database 1 & 2 are in the same instance.

I'd have to use nicknames instead. Is that right ?

Serge Rielau wrote:
Vivek wrote:
Hi,

Generally we work with the 2 part qualified table names in db2 i.e.
<schema>. <table name>
Is there a more fully qualified table name ? I've seen that a select
from <database name>.<schema>.<tabnamealso works.
Yes, as long as the db name is the db the object resides in or the local
db alias in case of dynamic SQL. This is more syntax toleration than
feature.
This brings me to the next question. Is it possible to refer to a
table in database 2 when connected to database 1 ? If so any
privileges that are required for doing that ?
DB2's approach to federation is through NICKNAMEs. Nicknames are like
ALIASes to remote objects.
You need to set the FEDERATED option in the DBM CFG to ON.
There are numerous introductions to federation on DeveloperWorks.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 20 '07 #3

P: n/a
Vivek wrote:
So i cannot refer to an object in another database (say database2) as

database2.<schema>.<tabname (when connected to database1)

even though database 1 & 2 are in the same instance.

I'd have to use nicknames instead. Is that right ?
Yes.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 20 '07 #4

P: n/a
Thanks Serge.

Serge Rielau wrote:
Vivek wrote:
So i cannot refer to an object in another database (say database2) as

database2.<schema>.<tabname (when connected to database1)

even though database 1 & 2 are in the same instance.

I'd have to use nicknames instead. Is that right ?
Yes.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 20 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.