On Wednesday 14 August 2002 07:03 am, Balaji  Nallathambi wrote:

I think you're expectation is simply wrong.

In MySQL recent versions if you use InnoDB tables you can create a 'foreign 
key' constraint. All this means is that you cannot create a record in a 
dependent table where the same value in the key does not exist in the master 
table. SQL has no mechanism for doing automatic updates to related tables 
(except triggers, which are not part of MySQL and not very standardized 
anyway). It is true that MS Access has such a feature, but you won't find it 
in SQL databases. You just have to write 2 queries, 1 to update each table.

I would have to advise you though, that if you are needing to change values 
in primary keys, your database is not properly designed. I would switch your 
key to a synthetic key design and use that as the foreign key constraint. You 
should never have to change the values of those keys in a well designed 
database.

> Hi all,
>
> Tho this is a Visual C++ Group i hope that i will get
> the result for my quesion with lot of hopes.
> I want to create an one to one relationship among
> tables using SQL. How can i do this. I creates an
> relation but it dose not expect my needs. For Ex they
> are two table say tbset nad tb tbprocess. If i set an
> one to one relation between the two tables in which
> the master table is tbset. If i change the values in
> the tbset table the change should be refleted in the
> slave table that is tbprocess. I think i can do this
> in msacess. But i changed to mysql in which i need to
> write the Query(There is no gui for mysql as like
> msacess). Pls Reply me regarding this
>
>
> __________________________________________________________
> Give your Company an email address like
> ravi @ ravi-exports.com.  Sign up for Rediffmail Pro today!
> Know more. http://www.rediffmailpro.com/signup/
>
>
> ---------------------------------------------------------------------
> 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