Monday, July 27, 2009

Constraints de una tabla

select
c.constrname,
i.idxname,
trim(t1.tabname) || '.' || trim(col1.colname),
t2.tabname
from
systables t1,
sysconstraints c,
sysindexes i,
syscolumns col1,
sysreferences r,
systables t2
where
t1.tabid = c.tabid and
t1.tabid = i.tabid and
c.idxname = i.idxname and
t1.tabid = col1.tabid and
i.part1 = col1.colno and
c.constrid = r.constrid and
r.ptabid = t2.tabid and
t1.tabname = 'AQUI AQUI'

No comments: