title: Oracle dates - SQL plus - Changing the date format used in INSERT statements
body: <p>I am trying to run a script that has the following insert statement through sqlplus</p>
  
  <pre><code>INSERT INTO mytable
  VALUES('423234','test',NULL,'05-DEC-2012 18:30:03.000000');
  INSERT INTO mytable
  VALUES('2343423','test',NULL,'05-DEC-2012 18:30:03.000000');
  INSERT INTO mytable
  VALUES('234234','test',NULL,'05-DEC-2012 18:30:03.000000');
  INSERT INTO mytable
  VALUES('234234','test',NULL,'05-DEC-2012 18:30:03.000000');
  INSERT INTO mytable
  VALUES('2342343','test',NULL,'05-DEC-2012 18:30:04.000000');
  </code></pre>
  
  <p>When i run the script i get the following error:</p>
  
  <pre><code>ERROR at line 2:
  ORA-01849: hour must be between 1 and 12
  </code></pre>
  
  <p>I thought this was just an issue with the NLS_DATEFORMAT parameter and all i had to do was change it for the session and it would work. The problem is i cant get the correct format. </p>
  
  <p>Here is what i tried but i get a date format not recognized error</p>
  
  <pre><code>alter session  set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS.FF';
  </code></pre>
  
  <p>Isn't the above pattern correct for date <code>'05-DEC-2012 18:30:04.000000'</code></p>
  
  <p>By the way the script runs fine on SQLDeveloper. </p>
  
  <p>Thanks</p>