title: Oracle cast(timestamp as date)
body: <p>I see an inconsistency in Oracle.
  The inconsistency is between the way INSERT timestamp data_type value into DATE data_type column works compared to the way CAST(timestamp as DATE) works.</p>
  
  <p>INSERT appears to simply cut off the milliseconds out of the timestamp value while CAST rounds them up to the closest second. </p>
  
  <p>Example:</p>
  
  <ol>
  <li><p>TEMP TABLE</p>
  
  <pre><code>create table test_timestamp_to_date 
  (date_col date, timestamp_col timestamp(6));
  </code></pre></li>
  <li><p>INSERTS:</p>
  
  <pre><code>insert into test_timestamp_to_date select 
  to_timestamp('11-OCT-2009 2:23:23.793915 PM'),
  to_timestamp('11-OCT-2009 2:23:23.793915 PM')
  from dual;
  
  insert into test_timestamp_to_date select 
  cast(to_timestamp('11-OCT-2009 2:23:23.793915 PM') as date),
  to_timestamp('11-OCT-2009 2:23:23.793915 PM')
  from dual;
  </code></pre></li>
  <li><p>RESULTS:</p>
  
  <pre><code>1* select to_char(date_col,'DD-MON-YYYY HH24:MI:SS') date_col, timestamp_col
       from test_timestamp_to_date
  SQL&gt; /
  
  DATE_COL             TIMESTAMP_COL
  -------------------- ----------------------------
  11-OCT-2009 14:23:23 11-OCT-09 02.23.23.793915 PM
  11-OCT-2009 14:23:24 11-OCT-09 02.23.23.793915 PM
  </code></pre></li>
  </ol>
  
  <h3>Question</h3>
  
  <p>Is there any easy way to avoid the rounding of milliseconds while using CAST?
  And I am not talking about use of TO_CHAR, TO_DATE combination with certain formatting; is there anything else?
  The coding with the CAST is already done, but I need a really easy fix.</p>