It is sometimes necessary to obtain the OBID of a table in order to carry out processing such as to unload data from an image copy of that table for loading to a new environment later.
Is it possible to obtain table OBID information in RC/Query for Db2 for z/OS (RCQ).
Yes, the DDO line command will generate the table DDL and include the OBID.
RQTL 20.0 --------------- RC/Q Table List --------------- yyyy/mm/dd hh:mm
COMMAND ===> SCROLL ===> CSR
DB2 Object ===> T Option ===> L Where => N
Table Name ===> table > Creator ===> authid1 >
Qualifier ===> * > N/A ===> * >
Loc: LOCAL ---------- SSID: ssid ----------authid1 - LINE 1 OF 1 >
CMD TABLE NAME CREATOR DATABASE TBLSPACE COL_CNT NUMBER OF ROWS
DDO_____ Table authid1 dbname tsname 8 N/A
******************************* BOTTOM OF DATA ********************************
.
.
.
.CONNECT ssid
SET CURRENT SQLID = 'authid1';
CREATE TABLE authid1.table
(EMPNO CHARACTER(6) FOR SBCS DATA
NOT NULL
,FIRST_NAME CHARACTER(50) FOR SBCS DATA
NOT NULL
,MIDDLE_NAME CHARACTER(50) FOR SBCS DATA
NOT NULL
,LAST_NAME CHARACTER(50) FOR SBCS DATA
NOT NULL
,WORK_GROUP CHARACTER(6) FOR SBCS DATA
WITH DEFAULT NULL
,PHONE_NO CHARACTER(10) FOR SBCS DATA
WITH DEFAULT NULL
,CONSTRAINT TBEMPEMPNO PRIMARY KEY
(EMPNO
)
)
IN dbnameP.tsname
APPEND NO
NOT VOLATILE CARDINALITY
DATA CAPTURE NONE
OBID 22
AUDIT NONE
CCSID EBCDIC;
This can be useful information when a table must be unloaded from an image copy where the object is not on the subsystem and the DDLDDN
card is used with Fast Unload for Db2 for z/OS (PFU) to do the unload.
When the DDLDDN is used to retrieve data from an image copy, include OBID in the FROM clause to unload the correct rows.
The DDL generated is used by the DDLDDN card and the OBID value is used on the SELECT statement in the unload cards.