Hello,

excuse me. I've looked at the wrong place. I found the solution at
www.innodb.com:

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;

This examples works great. 

Heiner Jostkleigrewe
> -----Ursprüngliche Nachricht-----
> Von:  Harald Fuchs [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Dienstag, 28. Mai 2002 12:46
> An:   [EMAIL PROTECTED]
> Betreff:      Re: Foreign Keys with MySQL 3.23.49 and 3.23.50
> 
> In article <[EMAIL PROTECTED]>,
> "Jostkleigrewe, Heiner" <[EMAIL PROTECTED]> writes:
> 
> >> sql,query
> >> 
> >> Hello,
> >> 
> >> i've tried the foreign key-example out of the documentation(3.5.6 Using
> >> Foreign Keys) on W2K (3.23.49 + 3.23.50) and LINUX (3.23.49). The
> tables
> >> persons and shirts are created as innodb-tables. 
> >> 
> >> I could insert a shirt for a non-existing person. Also i could delete a
> >> person with existing shirts. I have experimented with 'ON DELETE'  and
> 'ON
> >> UPDATE' with no effects.
> >> 
> >> What's wrong? Is there a switch to activate foreign keys?
> 
> No.  Could you post some SQL code which lets us reproduce the problem?

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to