title: "mysql for excel" insert statment changes values from excel
body: <p>Using excel 2010, mysql for excel latest version. </p>
  
  <p>Task: update existing mysql table</p>
  
  <p>issue: mysql for excel changes value to 0 (zero) for one column</p>
  
  <p>I can preview the sql statment and find the value and change insert statement but this isn't an option for large data set.</p>
  
  <p>Destination field in mysql has a foreign key set up, see below
  foreign key setup
  <a href="https://drive.google.com/file/d/0BzmA8MI6FMnwSU9ZbS1QVW94OGM/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0BzmA8MI6FMnwSU9ZbS1QVW94OGM/edit?usp=sharing</a></p>
  
  <p>Image of excel xls
  <a href="https://drive.google.com/file/d/0BzmA8MI6FMnwU1FzS1FYZEo5ZFE/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0BzmA8MI6FMnwU1FzS1FYZEo5ZFE/edit?usp=sharing</a></p>
  
  <p>mysql update insert statement as created by mysql for excel, see the second last field, if i change the 0 to a 1 then it suceeds</p>
  
  <p>error received with below statment is "MySQL Error 1452:</p>
  
  <pre><code>Cannot add or update a child row: a foreign key constraint fails (`quickset_ptracdb`.`activitylist`, CONSTRAINT `FK_ActivityList_ClientList` FOREIGN KEY (`alClientID`) REFERENCES `clientlist` (`cltID`))"
  
  INSERT INTO `quickset_ptracdb`.`activitylist` 
  (`alID`,`alName`,`alComment`,`alUOM`,`alPrice`,`alLabCost`,`alMatCost`,`alClientID`,`alExtCode`) 
  VALUES (12,'OB Add New Ca To Exist Spl Clsr','Installation of an additional copper cable in an existing non-pressurized splice. Excludes cable setup and actual splicing. Price Per Cable.',4,78.31,0,0,0,null);
  </code></pre>
  
  <p>Changing the above statement to this works:</p>
  
  <pre><code>INSERT INTO `quickset_ptracdb`.`activitylist` 
  (`alID`,`alName`,`alComment`,`alUOM`,`alPrice`,`alLabCost`,`alMatCost`,`alClientID`,`alExtCode`) 
  VALUES (12,'OB Add New Ca To Exist Spl Clsr','Installation of an additional copper cable in an existing non-pressurized splice. Excludes cable setup and actual splicing. Price Per Cable.',4,78.31,0,0,1,null);
  </code></pre>