473,796 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is SYSCAT.TABLES.T ABLEID 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.T ABLEID "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 6447
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************ **********@m79g 2000cwm.googleg roups.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.T ABLEID "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
2059
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 complete, it needs to be processed. Here's where the questions start. How can we easily determine in which tables a customer has data and how best to select that data? We're not opposed to putting all the data in a single table. This table would...
7
11835
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 tables that involve a number field as the primary key, the data is returned successfully. For tables that involve a character field (e.g. CHAR(3) or VARCHAR(10)) as the primary key, I have the correct number of rows returned, but the data displayed...
6
2930
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 what I'm doing. For instance when I try to run the trigger list with the code below, I get the error message: 42832-- SQL0607N "UPDATE" is not defined for system objects. SQLSTATE=42832 $sql = "SELECT trigname AS obj_name
4
2877
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 error ! here's a chunk of code <script language='javascript' type='text/css' > function removeElement(divNum,arrayCode,elementId) {
12
5181
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 attribute 'lastrowid' (Python DB API 2.0), it is always zero. Anyone figured this out? Thanks.
8
14611
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 dbname I would like to use perl DBI to get the relevant information.
5
13392
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
4999
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 between, say syscat.packages and syscat.routines. If anyone have sql for this I can live with that too :-) /Lennart
4
4722
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
9680
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...
1
10173
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
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
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();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
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
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.