Does the syscat.references table help u in what ur looking for?
select FK.CREATOR, FK.TBNAME, FK.COLNAME, FK.COLSEQ, PK.TBCREATOR,
PK.TBNAME, PK.NAME, R.RELNAME
from SYSIBM.SYSRELS R,
SYSIBM.SYSFOREIGNKEYS FK,
SYSIBM.SYSCOLUMNS PK
where R.CREATOR= ?
and R.TBNAME= ?
and R.RELNAME = FK.RELNAME
and R.CREATOR=FK.CREATOR
and R.TBNAME=FK.TBNAME
and R.REFTBCREATOR=PK.TBCREATOR
and R.REFTBNAME=PK.TBNAME
and FK.COLSEQ=PK.KEYSEQ
ORDER BY R.RELNAME, FK.COLSEQ asc
Yury Jhol
Chief Systems Architect
www.ispirer.com
> Hi,
>
[quoted text clipped - 4 lines]
> table, but it only gives me the reference/parent table information.
> Thanks lot!
forestever@gmail.com - 13 Jan 2005 16:50 GMT
This works, Thanks a lot!
> select FK.CREATOR, FK.TBNAME, FK.COLNAME, FK.COLSEQ, PK.TBCREATOR,
> PK.TBNAME, PK.NAME, R.RELNAME
[quoted text clipped - 23 lines]
> > table, but it only gives me the reference/parent table information.
> > Thanks lot!