473,659 Members | 3,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extract Nickname definition from system catalog tables.

OS: AIX 5L, DB2 UDB v8.2

the nicknames are created like this

create nickname <schema-name>.<tab-name for
<remote-db-name>.<remote-schema-name>.<remote-tabname>

The schema name is usually same as the remote db name while tabname is
the same as the remote tabname.

How can I extract these from syscat tables.

"<remote-db-name>.<remote-schema-name>.<remote-tabname>"

Any help appreciated. Thanks.

Dec 19 '06 #1
5 10114
Asphalt Blazer wrote:
OS: AIX 5L, DB2 UDB v8.2

the nicknames are created like this

create nickname <schema-name>.<tab-name for
<remote-db-name>.<remote-schema-name>.<remote-tabname>

The schema name is usually same as the remote db name while tabname is
the same as the remote tabname.

How can I extract these from syscat tables.

"<remote-db-name>.<remote-schema-name>.<remote-tabname>"
You get the information from SYSCAT.NICKNAME S. The remote database name
is "hidden" as server option, however, so you have to join those in as
well:

SELECT ( SELECT o.setting
FROM syscat.serverop tions AS o
WHERE o.servername = n.server_name AND
o.option = 'DB_NAME' ) || '.' ||
n.remote_schema || '.' ||
n.remote_table
FROM syscat.nickname s AS n

Note that this will only work if there is actually a database at the remote
data source, which is not mandatory.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Dec 19 '06 #2
I did a "select * from syscat.nickname s with UR"

It gives me this : SQL0204N "SYSCAT.NICKNAM ES" is an undefined name.
SQLSTATE=42704

Any idea?

I am working on LUW.
Thanks
Knut Stolze wrote:
Asphalt Blazer wrote:
OS: AIX 5L, DB2 UDB v8.2

the nicknames are created like this

create nickname <schema-name>.<tab-name for
<remote-db-name>.<remote-schema-name>.<remote-tabname>

The schema name is usually same as the remote db name while tabname is
the same as the remote tabname.

How can I extract these from syscat tables.

"<remote-db-name>.<remote-schema-name>.<remote-tabname>"

You get the information from SYSCAT.NICKNAME S. The remote database name
is "hidden" as server option, however, so you have to join those in as
well:

SELECT ( SELECT o.setting
FROM syscat.serverop tions AS o
WHERE o.servername = n.server_name AND
o.option = 'DB_NAME' ) || '.' ||
n.remote_schema || '.' ||
n.remote_table
FROM syscat.nickname s AS n

Note that this will only work if there is actually a database at the remote
data source, which is not mandatory.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Dec 19 '06 #3
SYSCAT.NICKNAME S looks like a v9 feature.

Any idea how to accomplish this on v8?

Thanks a bunch for the help.
Knut Stolze wrote:
Asphalt Blazer wrote:
OS: AIX 5L, DB2 UDB v8.2

the nicknames are created like this

create nickname <schema-name>.<tab-name for
<remote-db-name>.<remote-schema-name>.<remote-tabname>

The schema name is usually same as the remote db name while tabname is
the same as the remote tabname.

How can I extract these from syscat tables.

"<remote-db-name>.<remote-schema-name>.<remote-tabname>"

You get the information from SYSCAT.NICKNAME S. The remote database name
is "hidden" as server option, however, so you have to join those in as
well:

SELECT ( SELECT o.setting
FROM syscat.serverop tions AS o
WHERE o.servername = n.server_name AND
o.option = 'DB_NAME' ) || '.' ||
n.remote_schema || '.' ||
n.remote_table
FROM syscat.nickname s AS n

Note that this will only work if there is actually a database at the remote
data source, which is not mandatory.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Dec 19 '06 #4
Please try:
select * from syscat.taboptio n where tabname =?
Asphalt Blazer wrote:
I did a "select * from syscat.nickname s with UR"

It gives me this : SQL0204N "SYSCAT.NICKNAM ES" is an undefined name.
SQLSTATE=42704

Any idea?

I am working on LUW.
Thanks
Knut Stolze wrote:
Asphalt Blazer wrote:
OS: AIX 5L, DB2 UDB v8.2
>
the nicknames are created like this
>
create nickname <schema-name>.<tab-name for
<remote-db-name>.<remote-schema-name>.<remote-tabname>
>
The schema name is usually same as the remote db name while tabname is
the same as the remote tabname.
>
How can I extract these from syscat tables.
>
"<remote-db-name>.<remote-schema-name>.<remote-tabname>"
You get the information from SYSCAT.NICKNAME S. The remote database name
is "hidden" as server option, however, so you have to join those in as
well:

SELECT ( SELECT o.setting
FROM syscat.serverop tions AS o
WHERE o.servername = n.server_name AND
o.option = 'DB_NAME' ) || '.' ||
n.remote_schema || '.' ||
n.remote_table
FROM syscat.nickname s AS n

Note that this will only work if there is actually a database at the remote
data source, which is not mandatory.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 11 '07 #5
it should be:
select * from syscat.taboptio ns where tabname =?

george.zh...@lo mbard.ca wrote:
Please try:
select * from syscat.taboptio n where tabname =?
Asphalt Blazer wrote:
I did a "select * from syscat.nickname s with UR"

It gives me this : SQL0204N "SYSCAT.NICKNAM ES" is an undefined name.
SQLSTATE=42704

Any idea?

I am working on LUW.
Thanks
Knut Stolze wrote:
Asphalt Blazer wrote:
>
OS: AIX 5L, DB2 UDB v8.2

the nicknames are created like this

create nickname <schema-name>.<tab-name for
<remote-db-name>.<remote-schema-name>.<remote-tabname>

The schema name is usually same as the remote db name while tabname is
the same as the remote tabname.

How can I extract these from syscat tables.

"<remote-db-name>.<remote-schema-name>.<remote-tabname>"
>
You get the information from SYSCAT.NICKNAME S. The remote database name
is "hidden" as server option, however, so you have to join those in as
well:
>
SELECT ( SELECT o.setting
FROM syscat.serverop tions AS o
WHERE o.servername = n.server_name AND
o.option = 'DB_NAME' ) || '.' ||
n.remote_schema || '.' ||
n.remote_table
FROM syscat.nickname s AS n
>
Note that this will only work if there is actually a database at the remote
data source, which is not mandatory.
>
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 11 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
676
by: Damon | last post by:
Hi, I need to query each column's constraint and name of a table in postgreSQL v7.3.4 with a single SQL query but don't know how. Would appreciate any pointers! Thank you. Regards, Damon
2
11135
by: php newbie | last post by:
Hello, I am relatively new to SQL Server, although I have used Oracle extensively. In Oracle, there are system tables that you can query in order to get a list of all schemas and all the tables in them. Is there a similar concept in SQLServer? How would I find about the system dictionary tables?
1
1842
by: Jeffrey Sheldon via SQLMonster.com | last post by:
We hear about catalog table in documentation but is this the same as database schema? What is the definiation of catalog table? What does it pertain to? Thanks --
1
1685
by: Bruce Pullen | last post by:
UDB7.2 on AIX5.2 Specifically, I'd like to delete all data from SYSIBM.SYSSECTION and SYSIBM.SYSPLAN tables prior to doing a REORG to re-gain diskspace... without corrupting the database! The only other option I can think of to re-gain space is to use db2move or db2look. Can anyone advise? Thanks
0
1315
by: Jean-Marc Blaise | last post by:
Dear all, I have noticed the simulation catalog tables are created/dropped every time the Design Advisor is called to advise for MQT. It also seems necessary to drop thru -f option of the db2advis command those simulation tables. The problem is that those tables are logged, and we hit SQL0964C due to a huge catalog system (800Mb on a PeopleSoft database). What do you think of creating those simulation tables and ALTER TABLE ...
3
11342
by: reachsamdurai | last post by:
Is it possible to determine the list of child/parent tables for a particular table from any system catalog tables? Using the syscat.tables I'm able to retrieve the no of dependent parent/child tables but unable to determine the list of dependent table name(s) Example : For a simple department-employee relationship, the following query gives the count of parent/child tables but not the table names(s). db2 => select tabname,...
6
6207
by: Prasad | last post by:
Hi, We have DB2 7 fixpak 14 on AIX 5.1. There are federated links (nicknames) established for tables in Informix database. One of the table was modified in Informix. The table has now got 3 new columns. These columns are not seen in DB2 nickname definition. When we run the queries, we do not see these columns in the result. When we describe the nickname, these columns are not present.
5
5386
by: Sam Durai | last post by:
Do db2 system catalog table require maintenance (reorg/runstat) ? Thanks, Sam
1
2766
by: awesomewebsitesforyou | last post by:
Learn DB2 system catalog tables http://db2examples.googlepages.com/systemcatalogtables
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2752
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.