Discussion:
DB2v8.2 LUW. Unable to drop ForeignKey constraints..although DROP constraints returns undefined name
(too old to reply)
p***@hotmail.com
2007-10-31 16:49:03 UTC
Permalink
Hi all,
I have a perplexing DB2 Drop command situation. Environment I have tried severally to drop Foreign Key constraints on a set of

tables and each time I get a SQL0204N "SQL071030104307060" is an undefined name. ".
However, when I go back to look at the table or load data, I get a constraint error telling me that the same constraint that is a

undefined name exist. I run a generate ddl command for the table, indeed the constraint still do exist!

Be assured that I am logged in to the right instance, database, etc.
What can possibly be the problem here? How can I make sure these constraints are dropped?
Here's an example of one that I have tried to drop but no avail:
ALTER TABLE "ABCDE "."F_94_RPT_ADDR_T"
ADD CONSTRAINT "SQL071030104309760" FOREIGN KEY
("FAHIS_NBR_R")
REFERENCES "REPSP "."F_191_ABCDE_RPT_T"
("FAHIS_NBR_R")
ON DELETE RESTRICT
ON UPDATE NO ACTION


Thanks
Knut Stolze
2007-11-01 10:02:55 UTC
Permalink
Post by p***@hotmail.com
Hi all,
I have a perplexing DB2 Drop command situation. Environment I have tried
severally to drop Foreign Key constraints on a set of
tables and each time I get a SQL0204N "SQL071030104307060" is an
undefined name. ". However, when I go back to look at the table or load
data, I get a constraint error telling me that the same constraint that is
a
undefined name exist. I run a generate ddl command for the table, indeed
the constraint still do exist!
Be assured that I am logged in to the right instance, database, etc.
What can possibly be the problem here? How can I make sure these
constraints are dropped? Here's an example of one that I have tried to
ALTER TABLE "ABCDE "."F_94_RPT_ADDR_T"
ADD CONSTRAINT "SQL071030104309760" FOREIGN KEY
("FAHIS_NBR_R")
REFERENCES "REPSP "."F_191_ABCDE_RPT_T"
("FAHIS_NBR_R")
ON DELETE RESTRICT
ON UPDATE NO ACTION
As was already said in the other forum: check the DB2 catalog views to
identify the correct name of the constraint.
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Ian
2007-11-02 03:40:10 UTC
Permalink
Post by p***@hotmail.com
Hi all,
I have a perplexing DB2 Drop command situation. Environment I have tried severally to drop Foreign Key constraints on a set of
tables and each time I get a SQL0204N "SQL071030104307060" is an undefined name. ".
However, when I go back to look at the table or load data, I get a constraint error telling me that the same constraint that is a
undefined name exist. I run a generate ddl command for the table, indeed the constraint still do exist!
Be assured that I am logged in to the right instance, database, etc.
What can possibly be the problem here? How can I make sure these constraints are dropped?
ALTER TABLE "ABCDE "."F_94_RPT_ADDR_T"
ADD CONSTRAINT "SQL071030104309760" FOREIGN KEY
("FAHIS_NBR_R")
REFERENCES "REPSP "."F_191_ABCDE_RPT_T"
("FAHIS_NBR_R")
ON DELETE RESTRICT
ON UPDATE NO ACTION
The system date on your machine doesn't happen to be before
2007-10-30-10.43.09, does it?

I have seen this kind of oddity if you create an object in the database
and then set the clock to a time before the object was created...
Loading...