Hi Bennett,

----- Original Message -----
From: "Bennett Haselton" <[EMAIL PROTECTED]>


> Just wondering if anyone who knew the answer to this might have missed it
> before -- sorry to keep nagging but I really need to find out how, or
> whether, you can determine which fields in a table are foreign keys
> referencing another table.
>
> Is it not possible to determine, after a table is created, what fields in
> the table are foreign keys?  For a MyISAM table (where referential
> integrity is not enforced), is this information even retained?

Not yet for MyISAM, see
http://www.mysql.com/doc/A/N/ANSI_diff_Foreign_Keys.html
See also the info about InnoDB, which may do what you want.

>From a coder's point of view, I always give such columns a special name so I
know it references another table, and perhaps also also which one (and through
which column). I think that's good coding practice.
This just keeps the situation very clear to me, while coding, without having
to look up the table schema or rely on constraints.


Regards,
Arjen.

--
MySQL Training Worldwide, http://www.mysql.com/training/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Arjen G. Lentz <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Technical Writer
/_/  /_/\_, /___/\___\_\___/   Brisbane, QLD Australia
       <___/   www.mysql.com




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