Re: can't delete!!
Posted in 1998
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
joseph.luczynski@mindspring.com wrote:
-snip!-
> 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?
Apparently you've set up referencial integrity to this table and (some
of) the records you are trying to delete are currently being referenced.
You can look in sysreferences or a dbschema output to find what tables
are referencing the "switches" table, and then handle the data in those
tables however you choose.
If you're sure you want to wipe out any and all data in the tables that
are referencing the "switches" table, you could alter the foreign key(s)
to enable cascade deletes, and then run your delete statement again.
$.02,
j
--
Jay Hannah
Quality Service Management, Inc.
[v:] 402/397-7077 x29 [f:] 402/397-7576 [p:] 402/899-1793