cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ON DELETE CASCADE not functioning

Former Member
5,084

I am running sa 12.0.1.3726 and having issues with my system triggers when executing the following script

CREATE TABLE test1 (id INTEGER PRIMARY KEY);
CREATE TABLE test2 (id2 INTEGER PRIMARY KEY, id INTEGER, FOREIGN KEY id(id) REFERENCES test1(id) ON UPDATE CASCADE ON DELETE CASCADE);

insert into test1(id)values(1);
insert into test2(id2,id)values(1,1);
delete from test1;

I get Primary key for row in table 'test1' is referenced by foreign key 'id' in table 'test2' when it should be handled by the ON DELETE rule.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I have no issues with either 12.0.1.3456 or 12.0.1.3741.

Is this a simplified repro of a larger problem?

Is is possible that you have the fire_triggers option set, or used the -gf server option?

Former Member

It appears one of my earlier scripts turned off fire_triggers(then errored out and never turned it back on). Turned it back on and it functioned as expected

Breck_Carter
Participant
0 Likes

The answer is "fire_triggers", what is the question?

"How do I mess with people's minds?"

Correct! 🙂

Answers (0)