title: Weird behavior. Parameter for date column in oracle db
body: <p>I am getting this weird behavior in Oracle12. I am using oracle.managed.dataAccess in VisualStudio 2019</p>
  <p>Here is like, the situations:
  I am using a parameter variable (which is by default a string) and I am getting no results. The statement itself works(no error), but I'm not getting any db entrys back, cause of the date parameter.
  The date_column is type date in the db.</p>
  <pre class="lang-c++ prettyprint-override"><code>string sql = &quot;select * from Table where c_id = :myC_id and date_column &gt; to_date(:myDate, 'yyyy-mm-dd hh24:mi:ss')&quot;;
  
  OracleCommand cmd = new OracleCommand();
  cmd.Connection = connectionstring;
  cmd.CommadnText = sql;
  cmd.Parameters.Add(new OracleParameter(&quot;myC_id&quot;,myC_id)); 
  cmd.Parameters.Add(new OracleParameter(&quot;myDate&quot;,myDate)); 
  </code></pre>
  <p>I tried the parameter as string, as date, as everything. Converted it back and forth, still not working. BUT, if I hardcode the date as string like below it is working. I am getting the results and data.</p>
  <pre><code>string sql = &quot;select * from Table where c_id = :myC_id and date_column &gt; to_date('2021-03-30 09:00:00', 'yyyy-mm-dd hh24:mi:ss')&quot;;
  </code></pre>
  <p>I am getting the data too, if I concatenate my string variable to the sql string like below.</p>
  <pre><code>string myDate = &quot;'&quot; + &quot;2021-03-30 09:00:00&quot; + &quot;'&quot;;
  string sql = &quot;select * from Table where c_id = :myC_id and date_column &gt; to_date({myDate}, 'yyyy-mm-dd hh24:mi:ss')&quot;;
  </code></pre>
  <p>But its not working with the parameter, can someone tell me why, and how I make it work?</p>