title: Dapper, Oracle and Command Parameter
body: <p>I have a table in Oracle named MESSAGE and it has a column TERMINALID (VARCHAR2 8 NOT NULL); and there is an index for this column. There are about 300,000,000 records in this table.</p>
  
  <p>Now, <strong>this works fine (0.0 seconds)</strong>:</p>
  
  <pre><code>using (var con = new OracleConnection(connectionString2))
  {
      try
      {
          con.Open();
  
          var parameters = new DynamicParameters();
          parameters.Add("PTerminalId", value: "04447777", dbType: System.Data.DbType.AnsiString);
          Console.WriteLine("ora - messages #{0}", con.Query&lt;decimal&gt;("SELECT COUNT(*) FROM MESSAGE WHERE TERMINALID=:PTerminalId", param: parameters).FirstOrDefault());
      }
      finally { con.Close(); }
  }
  </code></pre>
  
  <p>And <strong>this fails (times out)</strong>:</p>
  
  <pre><code>using (var con = new OracleConnection(Properties.Settings.Default.GSMConnectionString2))
  {
      try
      {
          con.Open();
  
          Console.WriteLine("ora - messages #{0}", con.Query&lt;decimal&gt;("SELECT COUNT(*) FROM GSM.MESSAGE WHERE TERMINALID=:PTerminalId", param: new { PTerminalId = "04447777" }).FirstOrDefault());
      }
      finally { con.Close(); }
  }
  </code></pre>
  
  <p>Why it's so?</p>