title: Select a single column value and store it in variable oracle sql
body: <p>I want to grab a particular column value a.id and store it into a variable v_id. Then use this value to pass into a stored procedure.</p>
  
  <pre><code>DECLARE v_id a.id%TYPE;
  BEGIN
  SELECT id  into v_id from a where a.name='test' and rownum &lt;2 order by id desc;
  Print v_id;
  doSomething(v_id);
  END;
  /
  </code></pre>
  
  <p>I'm getting this error in Oracle SQL Developer:</p>
  
  <blockquote>
    <p>Error report: ORA-06550: line 3, column 7: PLS-00103: Encountered the
    symbol "V_ID" when expecting one of the following:</p>
    
    <p>:= . ( @ % ; The symbol ":=" was substituted for "V_ID" to
    continue.
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:</p>
  </blockquote>