title: Error in Oracle (PLS-00103: Encountered the symbol "="...) trying to select into a variable for use in a cursor
body: <p>I'm creating a procedure.  I'm selecting a max date from a table into a var, and then intending to use that var in sql for a cursor.  It looks like:</p>
  
  <pre><code>l_max_update_date      DATE;
  --Param var
  l_max_update_date := NULL;
  SELECT max(pivlog.last_update_date) as maxdate into l_max_update_date
  FROM piv_verification_log pivlog;
  </code></pre>
  
  <p>...and then...</p>
  
  <pre><code>--No data in log table?  Create a max_update_date
  IF l_max_update_date IS NULL
  THEN
  l_max_update_date := TO_TIMESTAMP('2014/SEP/1 00:00:00', 'YYYY/MON/DD HH24:MI:SS');
  END IF;
  </code></pre>
  
  <p>Finally...</p>
  
  <pre><code>--Get affected employees (those who have certified since the max(last_update_date) listed in the log table)
  CURSOR affected_employees_cursor
  IS
  SELECT    [columns]
  FROM      [tables]
  WHERE LAST_UPDATE_DATE &gt; l_max_update_date;
  </code></pre>
  
  <p>But, whenever I compile, I get this error message:</p>
  
  <blockquote>
    <p>[Error] PLS-00103 (47: 22): PLS-00103: Encountered the symbol "=" when expecting one of the following:
      constant exception 
       table long double ref
      char time timestamp</p>
  </blockquote>
  
  <p>which points at this line:</p>
  
  <pre><code>l_max_update_date := NULL;
  </code></pre>
  
  <p>I appreciate your insight.  I'm thinking it has to do with the order or location in the procedure where I'm defining the var and cursor(?).</p>
  
  <p>Thank you.</p>