473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Find my aliases


I have created several aliases to members using the CREATE ALIAS
command, but I lost track of them.

Now I want to see a catalog of all the aliases mapped to all members in
a FILE.

Is there a SQL commmand I can issue to see these?
Nov 12 '05 #1
4 16832
As always such information is stored in system catalogs:

select tabschema, tabname, base_tabschema, base_tabname from
syscat.tables where type = 'A'
You can export from that select to a file.

If you created aliases to aliases to find the real table names you need
to write recursive query ("with temp1" clause -- search in goole for
DB2 SQL Cookbook).

-- Artur Wronski

Nov 12 '05 #2
John Bailo wrote:

I have created several aliases to members using the CREATE ALIAS
command, but I lost track of them.

Now I want to see a catalog of all the aliases mapped to all members in
a FILE.

Is there a SQL commmand I can issue to see these?


Look in the system catalog table QSYS2/SYSTABLES.
There's some column in there (can't recall the name)
that identifies whether it's a table or alias.
Nov 12 '05 #3
select tabschema, tabname, base_tabschema, base_tabname from syscat.tables where type = 'A'

SQL State: 42704
Vendor Code: -204
Message: [SQL0204] TABLES in SYSCAT type *FILE not found. Cause . . . .
.. : TABLES in SYSCAT type *FILE was not found. If this is an ALTER
TABLE statement and the type is *N, a constraint or partition was not
found. If this is not an ALTER TABLE statement and the type is *N, a
function, procedure, or trigger was not found. If a function was not
found, TABLES is the service program that contains the function. The
function will not be found unless the external name and usage name do
not match exactly. Examine the job log for a message that gives more
details on which function name is being searched for and the name that
did not match. Recovery . . . : Change the name and try the request
again. If the object is a node group, ensure that the DB2 Multisystem
product is installed on your system and create a nodegroup with the
CRTNODGRP CL command. If an external function was not found, be sure
that the case of the EXTERNAL NAME on the CREATE FUNCTION statement
exactly matches the case of the name exported by the service program.

Processing ended because the highlighted statement did not complete
successfully

Artur wrote: As always such information is stored in system catalogs:

select tabschema, tabname, base_tabschema, base_tabname from
syscat.tables where type = 'A'
You can export from that select to a file.

If you created aliases to aliases to find the real table names you need
to write recursive query ("with temp1" clause -- search in goole for
DB2 SQL Cookbook).

-- Artur Wronski

Nov 12 '05 #4
John Bailo wrote:
> select tabschema, tabname, base_tabschema, base_tabname from

syscat.tables where type = 'A'

SQL State: 42704
Vendor Code: -204
Message: [SQL0204] TABLES in SYSCAT type *FILE not found. Cause . . . .


Then you probably want to tell us on which platform you are running and
which version of DB2 you are using. The above query works quite fine on
DB2 for Linux, Unix and Windows.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 12 '05 #5

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

Similar topics

9
by: P | last post by:
Hi, How would one get a list of encodings that can be passed to "".encode() I know base64,utf8,latin,ascii work and these are listed in the encodings and codecs modules, but where can one...
0
by: Andrew | last post by:
With command-line interface ( 3.23.37, UNIX Socket ) all is well with column aliasing. However, column aliases disappear in Excel, over ODBC, when there are multiple (joined) tables in the query. ...
5
by: Kevin | last post by:
I'm making my first attempt to put embedded SQL in a visual C++ application and I'm having trouble getting aliases to work. If I try the following SQL query on MS SQL 7.0 it works fine. SELECT...
0
by: Krzysiek | last post by:
Hi all, I have an issue with QSYS\QADBXREF file - it keeps aliases on tables. I take care of an application that works on many places (servers) and on one of them it's not possible to create...
67
by: PC Datasheet | last post by:
Transaction data is given with date ranges: Beginning End 4/1/06 4/4/06 4/7/06 4/11/06 4/14/06 4/17/06 4/18/06 4/21/06 426/06 ...
15
by: jacob navia | last post by:
Recently, we had a very heated thread about GC with the usual arguments (for, cons, etc) being exchanged. In one of those threads, we came into the realloc problem. What is the realloc...
22
by: Daniel Rucareanu | last post by:
I have the following script: function Test(){} Test.F = function(){} Test.F.FF = function(){} Test.F.FF.FFF = function(){} Test.F.FF.FFF.FFFF = function(){} //var alias = function(){}; var...
6
by: dom.k.black | last post by:
Is it still common practice to use type aliases (INT, PCHAR etc). It looks ugly and breaks the syntax highlighting, are there any advantages these days (MSVC++6.0 and later)? I could understand...
0
by: sweavo | last post by:
Hi all, (Python 2.5 under cygwin) I'm reading a bunch of XML files and merging them in memory - each file contains a number of packages which are to be merged: for fname in gInfiles: ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.