Re: can't delete!!
Posted in 1998
joseph.luczynski@mindspring.com wrote:
> First I get a list of tables in the database that have "switch_id" as a
> colname:
...
> It ain't working, so I just have it display the table that has it in it, and
> it shows one table, "switches".
>
> I try:
> delete from switches where switch_id = "2JB">
> and I get:
> 692: Key value for constraint (informix.switches_key) is still being> referenced.
>
> This switch_id is not in any other table in my database. Any ideas?
It isn't switch_id that it's complaining about; it's complaining about another
column - switeches_key. Apparently another table has a foreign key defined
against switches_key. Also note that the foreign key does not have to be called
"switches_key". It only has to be defined as referencing switches.switches_key.
You can use dbaccess table <switches> /info/constraints/reference/referenced to
identify which table is referencing switches_key. Or look in sysreferences &
syconstraints (the other way is easier).
June