Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » multi2
Re: multi2 [message #765 is a reply to message #764] Wed, 11 April 2007 11:59 Go to previous message
AJM is currently offline  AJM
Messages: 2350
Registered: April 2006
Location: Surrey, UK
Senior Member
Every table in a relational database is supposed to have a primary key. EMP_PHONE should therefore have a primary key of EMPLOYEE_ID + PHONE_ID which will prevent the same PHONE_ID from being added to the same EMPLOYEE_ID more than once. This will also allow an EMPLOYEE_ID to have more than one PHONE_ID, and allow a PHONE_ID to be shared by more than one EMPLOYEE_ID.

When you want to change an employee's phone number using this design what you have to do is DELETE the old one before INSERTING the new one. Some DBMS engines do not allow primary keys to be updated (which is why technical primary keys were invented in the first place), so this is the way to do it. The Radicore framework follows this traditional convention by not allowing any part of a primary key to be updated in its default processing. However, it is possible to update a primary key with custom code as I mentioned in a previous post.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: std.datevalidation.class.inc
Next Topic: Fatal Error: MySQL error: 1271
Goto Forum:
  


Current Time: Tue Jun 25 22:18:05 EDT 2024

Total time taken to generate the page: 0.01015 seconds