Re: Re: Foreign Keys and NULL

2002-05-30 Thread Egor Egorov
Chris, Thursday, May 30, 2002, 1:58:54 AM, you wrote: >> 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) >>

Re: Foreign Keys and NULL

2002-05-29 Thread Gabriel
> OI!!! I'm going to sound like a complete ass now (I know) But since > when does MySQL support FOREIGN keys?? *gasp* MAN this is going to > make my life S much easier *curses at phpMyAdmin for not having the > option* Do remember that this is only valid for mysql 3.23.50+

Re: Foreign Keys and NULL

2002-05-29 Thread Chris Knipe
> 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; OI!!! I'm goin

Foreign Keys and NULL

2002-05-29 Thread ashok
Hi, I am evaluating InnoDB's Foreign Keys and am stuck. Using the sample tables I want to add records in the Child table with a NULL parent_id (this being referenced to the Parent table) as follows: CREATE TABLE parent(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB; CREATE TABL