MAINFRAME - TIP OF THE DAY :
Q. If there is a situation, where we need to code more than 255 steps in a JOB?
A. We need to split jcl into two jcls , at the end of the first jcl check the condition code and initiate the second jcl.
Programmers Voted for below topics. Please Vote for good Posts.
Thank You! for your feedback. Connecting to the server. Please Wait...
Posted: Thu Nov 15, 2007 10:07 pm Post subject: CONSTRAINT with ON DELETE CASCADE
Hi to everyone:
I?m a real beginner in DB2 and I try to do a CONSTRAINT with ON DELETE CASCADE but it doesn't do what i need to do.
I assume that this constraint allows me to delete a row in the parent table(TABLA1), and the constraint automatically will delete all the dependent rows on the dependent table(TABLA2), or at least thats what I what to do.
The thing is that when I creat this contraint betwen two tables, and I try to delete a row from the parent table, I can't and it gives me an error. Something like the parent table isn't valid for the operation of delete.
I creat the constraint with this code:
ALTER TABLE TABLA2
FOREIGN KEY( CAMPO1 )
REFERENCES TABLA1 ( CAMPO3 )
ON DELETE CASCADE
ON UPDATE NO ACTION ;
I want to know if I'm doing something wrong on the code or if I have to do something else for the constraint works.
I will appreciate any help.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum