title: How do I select from an Oracle table with a timestamp(6)?
body: <p>In SAS, I create a data set (<code>dt</code>) with dates using seconds with 6 fractional decimals:</p>
  
  <pre><code>data dt;
    dt_21_aug_2017_23_59_59_999999 = '21aug2017:23:59:59.999999'dt;
    dt_01_jan_1960_23_59_59_999999 = '01jan1960:23:59:59.999999'dt;
  run;
  </code></pre>
  
  <p>Then I "format" the data set:</p>
  
  <pre><code>data dt_formatted;
       set dt;
  
       format dt_21_aug_2017_23_59_59_999999 datetime32.6;
       format dt_01_jan_1960_23_59_59_999999 datetime32.6;
  run;
  </code></pre>
  
  <p>I can see that the 6 fractional digits are preserved.</p>
  
  <p>I use <code>dt_formatted</code> to create an Oracle table:</p>
  
  <pre><code>libname tq84_ora  oracle 
     user                     = &amp;ora_user
     password                 = &amp;ora_password
     path                     = &amp;ora_server
  ;
  
  proc sql;
    create table  tq84_ora.dt_formatted as
    select * from work    .dt_formatted;
  quit;
  </code></pre>
  
  <p>The table is created, as desired, with two <code>timestamp(6)</code> columns.</p>
  
  <p>If I use <em>pass through</em> to query the table with a where condition, the inserted record is returned:</p>
  
  <pre><code>proc sql;
    connect to oracle (
      user = &amp;ora_user
      pw   = &amp;ora_password
      path = &amp;ora_server
    );
  
    select * from connection to oracle (
      select *
      from dt_formatted
      where dt_21_aug_2017_23_59_59_999999 = TO_TIMESTAMP(
          '21AUG2017:23:59:59.999999',
          'DDMONYYYY:HH24:MI:SS.FF',
          'NLS_DATE_LANGUAGE=American'
        )
    );
  
    disconnect from oracle;
  quit;
  </code></pre>
  
  <p>However, If I use the traditional way to select records, no record is returned:</p>
  
  <pre><code>proc sql;
    select * from tq84_ora.some_dates_date_format 
    where  dt_21_aug_2017_23_59_59_999999  = '21aug2017:23:59:59.999999'dt;
  quit;
  </code></pre>
  
  <p>However, If I select on <code>dt_01_jan_1960_23_59_59_999999</code>, the record is returned:</p>
  
  <pre><code>proc sql;
    select * from tq84_ora.some_dates_date_format 
    where  dt_01_jan_1960_23_59_59_999999  = '01jan1960:23:59:59.999999'dt;
  quit;
  </code></pre>
  
  <p>The reason seems to be a limitation with floating points. Still, this is strange since Oracle clearly stores the 2017 date with 6 digits (that are <code>9</code>).</p>
  
  <p>So, what can I do to select the 2017 record with the traditional <code>proc sql</code> approach?</p>