on 08-05-2015 11:21 AM
Hi Friends
When I open the DEFINTION of a Table which holds FOREIGN KEY it looks like this:
CREATE COLUMN TABLE "XXXXXX"."master_sample"
("ID" INTEGER CS_INT,"NAME" VARCHAR(20),"D_O_B" DAYDATE CS_DAYDATE,
PRIMARY KEY ("ID")) UNLOAD PRIORITY 5 AUTO MERGE ;
ALTER TABLE "XXXXXX"."master_sample" ADD FOREIGN KEY ( "NAME" ) REFERENCES "XXXXXX"."age_sample" ("C_NAME")
ON UPDATE RESTRICT ON DELETE RESTRICT
I run an ALTER COMMAND to get CASCADE effect on UPDATE & DELETE Operations with the following syntax.
ALTER TABLE "XXXXXX"."master_sample" ADD FOREIGN KEY ( "NAME" )
REFERENCES "XXXXXX"."age_sample" ("C_NAME") ON UPDATE CASCADE ON DELETE CASCADE;
I run it for Multiple times Successfully.
But again when I Open the Definition I still see the RESTRICT effect on UPDATE & DELETE Operations..
So how do I change my Table Defintion from ON UPDATE RESTRICT ON DELETE RESTRICT
to ON UPDATE CASCADE ON DELETE CASCADE ?????
Because of this i am not able to UPDATE the data in PRIMARY KEY Column holding Table(in the above example "age_sample")
Regards
Nagarjuna
Alter your table by dropping constraints, then try creating Cascade references.
ALTER TABLE TableName DROP CONSTRAINT ConstraintName
- Selva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.