Foreign Keys are nice but they are costly items to use, best enforce the
reference in your business logic of your application. You can still join and
look up based on references but the database is not responsible for
enforcing the relationship. Believe me they knew what they where doing when
they choose not to implement this. Good Luck....

-----Original Message-----
From: Peter Pentchev [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 5:09 AM
To: RAZAKA
Cc: [EMAIL PROTECTED]
Subject: Re: Create MULTIPLE TABLES ?

On Tue, May 15, 2001 at 12:43:02PM +0200, RAZAKA wrote:
> I would like to create multiple tables in a database.
> HowTo Use REFERENTIAL INTEGRITY with MySQL ?
> May I use "FOREIGN KEY" or "REFERENCES"?
> Note: MySQL Release = 3.23.36
>
> Thanks for help :)

In short, you can't..

>From the MySQL manual (Reference >> CREATE TABLE):

   * The `FOREIGN KEY', `CHECK', and `REFERENCES' clauses don't
     actually do anything.  The syntax for them is provided only for
     compatibility, to make it easier to port code from other SQL
     servers and to run applications that create tables with references.

G'luck,
Peter

--
What would this sentence be like if pi were 3?

---------------------------------------------------------------------
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


---------------------------------------------------------------------
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