zOs/SQL/CATOBID
with d as ( -- 5 13 11
select 5 obid, Name db, dbid
from sysibm.sysDatabase d
where d.name = 'DA540769'
)
select d.*, coalesce
('tb:' || strip(t.type) || ' '
|| strip(t.creator) || '.' || strip(t.name)
,'ts ' || strip(s.dbName) || '.' || strip(s.name)
,'ix ' || strip(i.creator) || '.' || strip(i.name)
, '?'
)
from d
left join sysibm.sysTables t
on t.dbName = d.db and t.dbid = d.dbid and t.obid = d.obid
left join sysibm.sysTableSpace s
on t.dbName is null
and s.dbName = d.db and s.dbid = d.dbid and s.obid = d.obid
left join sysibm.sysIndexes i
on t.dbName is null and s.dbName is null
and i.dbName = d.db and i.dbid = d.dbid and i.obid = d.obid
;x;
select s.*, t.*
from sysibm.sysTablespace s
, sysibm.sysTables t
where s.dbName = t.dbName and s.dbId = t.dbid
and s.obid = t.obid
with ur