systemtabllen
Posted in 2000
Topics: Triggers, Constraints & Referential Integrity
Hi ! wie kann ich aus der systemtabellen einer informix-datenbank herausfinden 1- welche tabellen stehen in abhaengigkeit (referenzen) 2- welche attribute welcher tabelle werden referenziert ? z.B. ABTEILUNG -----------arbeitet_in -----------ARBEITER ===> ABTEILUNG(ANR .. PRIMARY KEY) MITARBEITER(PNR ... , ANR ...., FOREIGN KEY ANR REFERENCES ABTEILUNG) herauszufinden ist dass ARBEITER.ANR ein fremdschlussel aus der tabelle ABTEILUNG ist! Danke fuer jede hilfe !
Sie müssen die systables, die sysconstraints und die sysreferences tabellen verbinden. mahdoui wrote: > Hi ! > wie kann ich aus der systemtabellen einer informix-datenbank > herausfinden > 1- welche tabellen stehen in abhaengigkeit (referenzen) > 2- welche attribute welcher tabelle werden referenziert ? > > z.B. > ABTEILUNG -----------arbeitet_in -----------ARBEITER > ===> > ABTEILUNG(ANR .. PRIMARY KEY) > MITARBEITER(PNR ... , ANR ...., FOREIGN KEY ANR REFERENCES > ABTEILUNG) > herauszufinden ist dass ARBEITER.ANR ein fremdschlussel aus der tabelle > ABTEILUNG ist! > > Danke fuer jede hilfe !
In Artikel <3875E4E7.8599C86D@informix.com> sagt mpruet@informix.com ... > Sie müssen die systables, die sysconstraints und die sysreferences > tabellen verbinden. > > mahdoui wrote: > Die sysindexes fehlt noch.
Hier spricht man Deutsch ? mahdoui wrote: > > Hi ! > wie kann ich aus der systemtabellen einer informix-datenbank > herausfinden > 1- welche tabellen stehen in abhaengigkeit (referenzen) > 2- welche attribute welcher tabelle werden referenziert ? > > z.B. > ABTEILUNG -----------arbeitet_in -----------ARBEITER > ===> > ABTEILUNG(ANR .. PRIMARY KEY) > MITARBEITER(PNR ... , ANR ...., FOREIGN KEY ANR REFERENCES > ABTEILUNG) > herauszufinden ist dass ARBEITER.ANR ein fremdschlussel aus der tabelle > ABTEILUNG ist! > > Danke fuer jede hilfe !
Looks like you want to know how to find primary and foreign key relationships from the system catalog tables in Informix. The sysconstraints table contains the costraints and tabid of the constrained table. The contrtype column defines the type of constraint ("P"-primary, "U"-unique, "R"-Foreign key or 'reference' constraint). The sysreferences table is linked to the type 'R' constraints by contrid and contains columns primary and ptabid which contain the contrid of the PRIMARY or UNIQUE constraint to which the foreign key refers and the tabid of the PRIMARY KEY table. It also contains the name of the index supporting the foreign key on the referring table. See the source file print_contraints.ec from my myschema utility for examples of decoding these relationships from both directions. Art S. Kagel Stefan Weideneder wrote: > > Hier spricht man Deutsch ? > > mahdoui wrote: > > > > Hi ! > > wie kann ich aus der systemtabellen einer informix-datenbank > > herausfinden > > 1- welche tabellen stehen in abhaengigkeit (referenzen) > > 2- welche attribute welcher tabelle werden referenziert ? > > > > z.B. > > ABTEILUNG -----------arbeitet_in -----------ARBEITER > > ===> > > ABTEILUNG(ANR .. PRIMARY KEY) > > MITARBEITER(PNR ... , ANR ...., FOREIGN KEY ANR REFERENCES > > ABTEILUNG) > > herauszufinden ist dass ARBEITER.ANR ein fremdschlussel aus der tabelle > > ABTEILUNG ist! > > > > Danke fuer jede hilfe !
Nur einege heir sprechen Deutsch, und dann moeglicherweise nur ein bischen. ;-) Aber die meisten wird besser auf English verstehen. Stefan Weideneder wrote: > Hier spricht man Deutsch ? > > mahdoui wrote: > > > > Hi ! > > wie kann ich aus der systemtabellen einer informix-datenbank > > herausfinden > > 1- welche tabellen stehen in abhaengigkeit (referenzen) > > 2- welche attribute welcher tabelle werden referenziert ? > > > > z.B. > > ABTEILUNG -----------arbeitet_in -----------ARBEITER > > ===> > > ABTEILUNG(ANR .. PRIMARY KEY) > > MITARBEITER(PNR ... , ANR ...., FOREIGN KEY ANR REFERENCES > > ABTEILUNG) > > herauszufinden ist dass ARBEITER.ANR ein fremdschlussel aus der tabelle > > ABTEILUNG ist! > > > > Danke fuer jede hilfe ! -- Madison Pruet =========================================== Enterprise Replication Product Developement Dallas, Texas Informix Software ===========================================