Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

foreign key constraint

foreign key constraint

foreign key constraint


I am experiencing problems while implementing foreign key
columns in tables . The problem is that even after giving
the references clause in the foreign table the column
allows values that are not there in the master table.

i am using references master_table( primary_key_col )
match full .
any immediate replies will be appreciated.


RE: foreign key constraint


The mysql manual on foreign keys. My understanding is they're not actually implemented. It'll accept the syntax, but calling it a foreign key, and setting references won't make it any different than any other column.

Later on in the manual (http://mysql.org/Manual_chapter/manual_Reference.html#CREATE_TABLE)is this note:
"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."

You should really have read this already. It's a very useful manual.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close