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

Why is SYSCAT.TABLES.TABLEID not unique?

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.