title: Using date in ref cusor with pl/sql
body: <p>I have a var: <em>acc_date</em>  with type date.</p>
  
  <p>It takes its value from a cursor and when I insert its value to logger table as:</p>
  
  <pre><code>insert into logger values(1,acc_date);
  </code></pre>
  
  <p>the out put when a select it from logger is </p>
  
  <pre><code>1   01-JAN-10
  </code></pre>
  
  <p>but when i use it to compare with another Date value in another cursor as</p>
  
  <pre><code>OPEN c_get_date_id 
   for 'SELECT Date_D.DATEKEY from Date_D where Date_D.DATEVALUE='||acc_date;
       EXIT WHEN c_get_date_id%NOTFOUND;
       FETCH c_get_date_id
          INTO date_id;
        insert into logger values (1,'Now with date_id'||date_id);
  CLOSE c_get_date_id;
  </code></pre>
  
  <p>an error occurs:</p>
  
  <pre><code>Error report:
  ORA-00904: "JAN": invalid identifier
  ORA-06512: at "HW.FILLFACT", line 82
  ORA-06512: at line 1
  00904. 00000 -  "%s: invalid identifier"
  *Cause:    
  *Action:
  </code></pre>
  
  <p><strong>strong text</strong></p>