title: Adding a NULL value for a datetime entry in an SQL table through Bash
body: <p>I am attempting to populate an SQL table through reading text files via bash to hand off to the table. I have it all working except when trying to add a null value to a datetime field.</p>
  
  <pre><code>mysql --host 10.100.10.19 --port 3306 -utest -ptest &lt;&lt; EOF
  INSERT INTO imaging.imagestatus (StatusDate, FileName, FolderName, Status, User, CaptureDate, Kind, Preview) VALUES ('2013-05-01T15:25:55', 'fileName1', 'folderName1', 'Status1', 'User1', 'NULL', 'kind1', 'preview1');
  EOF
  </code></pre>
  
  <p>I keep getting:</p>
  
  <pre><code>ERROR 1292 (22007) at line 1: Incorrect datetime value: 'NULL' for column 'CaptureDate' at row 1
  </code></pre>
  
  <p>for the value labeled 'NULL' which is a data type datetime in the table. I have tried the combinations '\N', '\N', 'NULL', 'null' and ' '</p>
  
  <p>I started to use a temporary date: 00-00-00 00:00:00 but I want it to match other null entry formats or just a blank space in the table. Thanks for the help!</p>
  
  <p>ANSWER-- As was implemented</p>
  
  <p>The value in the text file name "NULL" that is pulled in can be swapped with a variable like a=NULL to get a correct NULL value for a datetime input.</p>