convolution redefined
Posted in 1997
Topics: Triggers, Constraints & Referential Integrity
I'm trying to get what I think is simple information from the System catalogs, but it's turning out to be a real killer trying to get it out. To start off, I'll identify the system: I'm working in Informix Online vs. 5.03. I want to get, given a table id, the names of all the columns in the table which are foreign keys and the tables they reference. I thought that would be simple enough, but after sifting through the Online reference, the best I could do was the monster which follows (assuming a table id of 181). PLEASE someone tell me there's an easier way... select k.colname, t.tabname from syscolumns k, systables t, sysindexes i, sysconstraints c, sysreferences r where k.tabid=i.tabid and i.tabid=181 and i.part1=k.colno and i.idxname=c.idxname and c.constrtype="R" and c.constrid=r.constrid and r.ptabid=t.tabid Thanks, Adi. ---------------------------------------------------------------- Adi Lachman phone: (972) 9-9522721 Motorola Semiconductor Israel email: r53837@email.sps.mot.com ---------------------------------------------------------------- -------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to Usenet