|
View previous topic :: View next topic
|
| Author |
Message |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Hi,
I created a foreign key with "NOT ENFORCED" option.
| Code: |
ALTER TABLE BHATAB01
ADD CONSTRAINT BHAC1 FOREIGN KEY
(C1
)
REFERENCES BHATS002
(COL1
)
ON DELETE RESTRICT
NOT ENFORCED; |
Now when I try running any insert on the child table I notice that the RI constraints are not enforced.
My question is how do I activate the RI constraint now? Can I do It using alter statement? If yes then how? |
|
| Back to top |
|
 |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Hi..
Any updates on this? |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10902 Location: italy
|
|
|
|
| Quote: |
| Any updates on this? |
seem a pretty stupid question... did You see any ?
remember, answering on a forum is ...
on voluntary base
on our time
depends on how interesting is the topic
also remember that soliciting/pestering for answers is just bad forum manners
( on many forums it might get You banned )
what happened also when You looked at the db2 manuals for the syntax of the ALTER command
because You looked ... didn' t You ???
rethoric question
if You had looked You would not have asked  |
|
| Back to top |
|
 |
Bang_1
New User
Joined: 08 May 2009 Posts: 39 Location: Bangalore
|
|
|
|
| Hi Bharat, can you drop and create the same RI with ENFORCED |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| What did your DBA say? |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10902 Location: italy
|
|
|
|
He is the DB2 DBA !  |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| enrico-sorichetti wrote: |
He is the DB2 DBA !  |
I know Enrico. Thought it was a fun question/response. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10902 Location: italy
|
|
|
|
looks like the typical case of
when <You> ask Yourself a question...
the reply will certainly be wrong |
|
| Back to top |
|
 |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
yes... i know that we can drop the RI and re-create it with enforced option -- then followed by a check data utility.
I was wondering if there are any other ways to achieve it.. like a simple alter statement? |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| Did you try that? |
|
| Back to top |
|
 |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
| yes i tried it.... dropped and recreate worked for me.... |
|
| Back to top |
|
 |
|
|