Ref Constraints
Posted in 1999
I am having following confugration
IFX 7.13 UC1 on Sun solaris 2.6
The database is not properly designed i.e. no constraints are put. I have
developed a querry which shall list me
the table names which carry a particular column name and constraints on it.
Following is the querry
database ola;
select unique tabname,constrtype co,idxname,coltype,collength,nrows
from syscolumns b,systables a,outer( sysconstraints d,syscoldepend c,
sysreferences e)
where a.tabid > 99
and a.tabid = b.tabid
and b.tabid = c.tabid
and b.colno = c.colno
and ((c.tabid = d.tabid and c.constrid = d.constrid) or
(c.tabid = e.ptabid and c.constrid = e.constrid))
and colname = 'new_app_prg_code'
and tabtype = 'T'
and constrtype != 'N'
order by 1
I am unable to find value of syscoldepend->constrid in any other tables.
e.g. for colname = 'new_app_prg_code'
constrid = 1076 (in syscoldepend table) and sysconstraints or sysreferences
do not contain this value at all.(although I have
defined Ref intergrity on this column !)
Can anybody shed light in which table I can find constrid value ?
TIA