using systables in table constraint
Posted in 1994
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.
create table foo (
footable char(18) references systables(tabname)
);
Is there a way to guarantee that the table names
identified in footable are in the database?
----------------------------------------------------
Seth J Hllman | email: sjhillman@tasc.com
TASC | phone: 617/942-2000 x2250
55 Walkers Brook Drive | fax: 617/942-7100
Reading, MA 01867 |
----------------------------------------------------