473,387 Members | 1,575 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,387 software developers and data experts.

Why is SYSCAT.TABLES.TABLEID not unique?

Hi all,

I need to get a unique identifier for tables created in DB2 v8.1. I
can't use the table name because I want to use the identifier as part
of a trigger name and the table names are already at the maximum
allowed length.

Originally, I wanted to make use of the SYSCAT.TABLES.TABLEID "internal
identifier" but found that it is not unique. Surely DB2 must have some
unique object identifiers somewhere that can be accessed by providing
the corresponding object name? So, I guess what I am looking for is a
DB2 equivalent of the 'sysobjects.id' column in SQL Server.

Does anyone know of some way I can obtain this information or solve the
problem otherwise? Please note that the table names cannot be changed
at all.

Thanks,

Ryan

Sep 8 '06 #1
3 6377
TBSPACEID + TABLEID are unique.
TABLEID is only unique within a tablespace

Note that in DB2 9 range partitioned tables get a proxy TABLEID.

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 8 '06 #2
In article <11**********************@m79g2000cwm.googlegroups .com>,
ry******@s1.com says...
Hi all,

I need to get a unique identifier for tables created in DB2 v8.1. I
can't use the table name because I want to use the identifier as part
of a trigger name and the table names are already at the maximum
allowed length.

Originally, I wanted to make use of the SYSCAT.TABLES.TABLEID "internal
identifier" but found that it is not unique. Surely DB2 must have some
unique object identifiers somewhere that can be accessed by providing
the corresponding object name? So, I guess what I am looking for is a
DB2 equivalent of the 'sysobjects.id' column in SQL Server.

Does anyone know of some way I can obtain this information or solve the
problem otherwise? Please note that the table names cannot be changed
at all.
It's the combination of TABLEID and TABLESPACEID which makes it unique.
Maybe even the partition id or something like that should be used also
but I'm not familiar with the partitioning feature.
Sep 8 '06 #3

Serge Rielau wrote:
TBSPACEID + TABLEID are unique.
TABLEID is only unique within a tablespace

Note that in DB2 9 range partitioned tables get a proxy TABLEID.
Ah, thanks for the fast turnaround.

Thanks for the info,

Ryan

Sep 8 '06 #4

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

Similar topics

10
by: heromull | last post by:
We have an asp.net app with about 200 data entry forms. Customers may enter data into any number of forms. Each form's data is persisted in a corresponding sql table. When data entry is...
7
by: Joe | last post by:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource (using Oracle ODBC drivers). After linking the tables in Access, I inspect the data contained in the linked tables. For...
6
by: Bob Stearns | last post by:
I am trying to write a small app in php to make the 'COMMENT' statement a bit more friendly, so we might do more documentation. My problem is a set of error statements which have nothing to do with...
4
by: Steve | last post by:
hi all, i'm using DHTML to generate a dynamic table with adding removing and sorting rows the thing is after a row has been added at a position that i specify, if i try to delete it i get this...
12
by: Dale Strickland-Clark | last post by:
Now that OIDs have been deprecated in PostgreSQL, how do you find the key of a newly inserted record? I've tried three Python client libraries, including psycopg2, and where they support cursor...
8
by: dcruncher4 | last post by:
Can I get the equivalent information for the following commands using SYSCAT or SYSIBM tables. db2 list tablespace containers for 14 show detail db2 list history backup since 20061018 for...
5
by: Fibbo | last post by:
Pretty new to SQL: I have the following scenario: Table1 (TableID int , Value1 varchar(50)) Table 2 (Table2ID int , Value1 varchar (50))
10
by: Lennart | last post by:
I see a bunch of packages where valid <'Y'. What I cant figure out is how to relate the package to a procedure, function or whatever. Does anyone have a reference to share on the relationship...
4
by: d0m_at0m | last post by:
hello, how to select a table that has a highest amount of columns (compared to other tables) using syscat? thanks in advance
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...

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.