title: PLSQL - Store a select query result in variable throw error
body: <p>I want to store a select query result in a variable in PLSQL.</p>
  
  <pre><code>SQL&gt;var v_storedate VARCHAR2(19);
  SQL&gt;exec :v_storedate := 'select cdate from rprt where cdate between  cdate AND TO_CHAR(sysdate, 'YYYY/MM/DD-HH24-MI-SS-SSSSS') and ryg='R' and cnum='C002'';
  </code></pre>
  
  <p>As </p>
  
  <pre><code>SQL&gt;select cdate from rprt where cdate between  cdate AND TO_CHAR(sysdate, 'YYYY/MM/DD-HH24-MI-SS-SSSSS') and ryg='R' and cnum='C002';
  </code></pre>
  
  <p>Returns : 2013/04/27-10:06:26:794</p>
  
  <p>But it throws error:</p>
  
  <pre><code> ERROR at line 1: ORA-06550: line 1, column 121: PLS-00103: Encountered
   the symbol "YYYY" when expecting one of the following:
   * &amp; = - + ; &lt; / &gt; at in is mod remainder not rem &lt;an exponent (**)&gt; &lt;&gt; or != or ~= &gt;= &lt;= &lt;&gt; and or like LIKE2_ LIKE4_ LIKEC_ between ||
   multiset member SUBMULTISET_ The symbol "*" was substituted for "YYYY"
   to continue. ORA-06550: line 1, column 148: PLS-00103: Encountered the
   symbol ") and ryg=" when expecting one of the following: . ( * @ % &amp; =
   - + ; &lt; / &gt; at in is mod remainder not rem &lt;an exponent (**)&gt; &lt;&gt; or != or ~= &gt;= &lt;= &lt;&gt; and or like LIKE2_ LIKE4_ LIKEC_ between
  </code></pre>