List:General Discussion« Previous MessageNext Message »
From:SGreen Date:May 27 2004 1:23pm
Subject:Re: Foreign Key Constraints
View as plain text  
You could create a special "borrower" account to signify that it is not
loaned out and assign that to the book.  If this is for a library system
(multiple branches) you could create one account for each branch. That way
you would know where the book is at all times, "borrowed" or not.... ;-)

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


                                                                                          
                                      
                      <kyuubi@stripped                                                
                                         
                      m>                       To:       mysql@stripped         
                                         
                                               cc:                                        
                                      
                      05/27/2004 12:22         Fax to:                                    
                                      
                      AM                       Subject:  Foreign Key Constraints          
                                      
                      Please respond to                                                   
                                      
                      kyuubi                                                              
                                      
                                                                                          
                                      
                                                                                          
                                      




Hi, I am trying to use the foreign key constraints from InnoDB
and creating indexes is a requirement for foreign key.
The problem is that by creating index for my foreign key,
it does not allow my foreign key to have null or blank values which my
records will have.
For eg. a BorrowerID is a foreign key on a Book table, but when the book is
not borrowed,
the BorrowerID will be null and I can't seem to import the data containing
null values for the foreign key.
Is there a way to solve this?
Thanks.





---- Msg sent via Spymac Mail - http://www.spymac.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1






Thread
Foreign Key Constraintskyuubi27 May
  • Re: Foreign Key ConstraintsJeff Smelser27 May
  • Re: Foreign Key ConstraintsColin Bull27 May
  • Re: Foreign Key ConstraintsRobert J Taylor27 May
  • Re: Foreign Key ConstraintsMartijn Tonies27 May
    • Re: Foreign Key ConstraintsJeff Smelser27 May
  • Re: Foreign Key ConstraintsMartijn Tonies27 May
  • Re: Foreign Key ConstraintsMartijn Tonies28 May
    • Re: Foreign Key ConstraintsJeff Smelser28 May
  • Re: Foreign Key ConstraintsMartijn Tonies28 May
    • Re: Foreign Key ConstraintsMichael Stassen28 May
      • Re: Foreign Key ConstraintsMichael Stassen28 May
  • Re: Foreign Key ConstraintsMartijn Tonies28 May
    • Re: Foreign Key ConstraintsJeff Smelser28 May
    • Re: Foreign Key ConstraintsJeff Smelser28 May
  • Re: Foreign Key ConstraintsMartijn Tonies28 May
Re: Foreign Key ConstraintsSGreen27 May