Re: innodb on delete cascade

2003-08-14 Thread Victoria Reznichenko
) ON DELETE cascade ) TYPE=INNODB; Now, insert a couple of lies of data: mysql insert into parent values(1); Query OK, 1 row affected (0.00 sec) mysql insert into parent values(2); Query OK, 1 row affected (0.00 sec) mysql insert into parent values(3); Query OK, 1 row affected

Re: innodb on delete cascade

2003-08-14 Thread R.Dobson
Hi, yes, I should have included in the first mail. They are: mysql show table status like 'gene%';

Re: innodb on delete cascade

2003-08-14 Thread Victoria Reznichenko
R.Dobson [EMAIL PROTECTED] wrote: Hi, i'm using Distrib 4.0.1-alpha, for sun-solaris2.8 (sparc) It's an outdated version and it doesn't support ON DELETE, just parsed. Upgraid MySQL to the recent version (4.0.14) -- For technical support contracts, goto https://order.mysql.com/?ref=ensita

Re: innodb on delete cascade

2003-08-14 Thread R.Dobson
, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE cascade ) TYPE=INNODB; Now, insert a couple of lies of data: mysql insert into parent values(1); Query OK, 1 row affected (0.00 sec) mysql insert into parent values(2); Query OK, 1 row affected

innodb on delete cascade

2003-08-14 Thread R.Dobson
Hi, I have a db where I have converted all the tables innodb. I have 2 tables in particular called gene and name. They both have a primary key call id. I want the primary key from name to be deleted when the corresponding key is deleted from gene. It doesn't seem to be happening as yet! show

Re: innodb on delete cascade

2003-08-14 Thread R.Dobson
mmm, i've just tried the example within the mysql docs: CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABLE child(id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE cascade ) TYPE=INNODB

Re: innodb on delete cascade

2003-08-14 Thread Jeff Mathis
(parent_id), FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE cascade ) TYPE=INNODB; Now, insert a couple of lies of data: mysql insert into parent values(1); Query OK, 1 row affected (0.00 sec) mysql insert into parent values(2); Query OK, 1 row affected (0.00

Re: innodb on delete cascade

2003-08-14 Thread Jeff Mathis
we're using a slightly different syntax. add the word constraint in front of foreign key. alter table name add constraint foreign key(id) references gene(id) on delete cascade; we rely on cascading deletes. This works in our case. good luck. R.Dobson wrote: Hi, yes, I should have included

Re: innodb on delete cascade

2003-08-14 Thread Egor Egorov
R.Dobson [EMAIL PROTECTED] wrote: Hi, I have a db where I have converted all the tables innodb. I have 2 tables in particular called gene and name. They both have a primary key call id. I want the primary key from name to be deleted when the corresponding key is deleted from gene. It

Re: innodb on delete cascade

2003-08-12 Thread Jeff Mathis
I just looked at your table syntax. you've got two auto_increment pk columns. do you always have a 1:1 correspondence between the name and gene tables? would it not be better to have a gene_id column in name, put an index on it, and then issue: alter table name add foreign key(gene_id) references