on delete cascade?

Helo
please
can someone tell mi wat is wrong with this?
I type:
create table projects(proj_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,proj_name varchar(30)unique)TYPE=InnoDB;

mysql> create table subprojects(sproj_id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,proj_id INTEGER NOT NULL REFERENCES projects.proj_id ON DELETE CASCADE ON UPDATE CASCADE,sproj_code varchar(7) unique) TYPE=InnoDB;

mysql> insert into projects(proj_name) values('fideli');

mysql> insert into subprojects(proj_id,sproj_code) values(1,'AGAL');

mysql> delete projects.* from projects where proj_id=1;

this removes the column in projects..
but the column referenced to in the subprojects-table is still there
Shouldnt it be gone?
wat is wrong?

/Fidelie

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion