Re: using systables in table constraint
Posted in 1995
sjhillman@tasc.com (Seth J. Hillman) writes: >In my database, I have a table (foo) which has a >column (footable) that stores table names. The tables >listed in column footable are used as lookup tables by my >application. Is there a way to place a constraint on >on footable such that the table name must be a valid >table? >I tried a constraint that references tabname >in systables, but I get error 297. I looked in the >sys admin manual and determined that there was no unique >index on tabname therefore I cannot place a reference >on the column. I tried placing the constraint on tabname >and owner, but I get the same error. An untried idea: Can a constraint be placed on a view? If so, create a view against systables where tabid > 99, create a PK on the view.tabname, then proceed. I'm not enough of a view expert to say this will positively work, but maybe ... ======================================================================= Dennis J. Pimple dennisp@informix.com Opinions expressed Senior Consultant -------------------- are mine, and do not Informix Software Inc Voice: 303-850-0210 necessarily reflect Denver Colorado USA Fax: 303-779-4025 those of my employer.