title: pl/sql - to_date not working with execute immediate parameter
body: <p>i wanna be able to execute my below proc like so:</p>
  
  <pre><code>exec procname('29-JAN-2011');
  </code></pre>
  
  <p>proc code is:</p>
  
  <pre><code>PROCEDURE procname(pardate VARCHAR2) IS
  
    vardate DATE := to_date(pardate, 'DD-MON-YYYY');
    SQLS VARCHAR2(4000);
  
  BEGIN    
  
    SQLS := 'SELECT cola, colb
               FROM tablea 
              WHERE TRUNC(coldate) = TRUNC(TO_DATE('''||pardate||''',''DD/MON/YYYY''))';
  
    EXECUTE IMMEDIATE SQLS;
  
  END;
  </code></pre>
  
  <p>It keeps throwing error:</p>
  
  <blockquote>
    <p>ORA-00904: "JAN": invalid identifier.</p>
  </blockquote>
  
  <p>It compiles, but it throws the error when I run this command:</p>
  
  <pre><code>EXEC procname('29-JAN-2011');
  </code></pre>