title: Oracle SQL Using Variables Not Running
body: <p>This is probably an elementary question, but I'm new to Oracle SQL.  I'm trying to get the SQL below to execute in Oracle SQL Developer.  The error information is below the code.  I've modified the code since I pasted the error message.  Line 28 is the last line in the code, &quot;END;&quot; Line 14 column 1 refers to the word &quot;Select&quot;.</p>
  <pre><code>DECLARE 
      v_StartDate Date := &amp;StartDate;
      v_EndDate Date := &amp;EndDate;
  
  SET v_StartDate := CASE &amp;StartDate
  WHEN TO_DATE('01/01/1900','MM/DD/YYYY')
  THEN LAST_DAY(ADD_MONTHS(trunc(current_date),-2))
  ELSE TO_DATE(&amp;StartDate - 1) END;
  SET v_EndDate := CASE &amp;StartDate
  WHEN TO_DATE('01/01/1900','MM/DD/YYYY')
  THEN LAST_DAY(ADD_MONTHS(&amp;EndDate,-1))
  ELSE TO_DATE(&amp;EndDate + 1) END;
  
  BEGIN
  Select *
  From
  Table
  Where date_value &gt; v_StartDate
  and date_value &lt; v_EndDate
  END;
  </code></pre>
  <p>Error report -
  ORA-06550: line 28, column 24:
  PL/SQL: ORA-00933: SQL command not properly ended
  ORA-06550: line 14, column 1:
  PL/SQL: SQL Statement ignored
  ORA-06550: line 28, column 27:
  PLS-00103: Encountered the symbol &quot;end-of-file&quot; when expecting one of the following:</p>
  <p>( begin case declare end exception exit for goto if loop mod
  null pragma raise return select update while with
   
   &lt;&lt; continue close current delete fetch lock
  insert open rollback savepoint set sql execute commit forall
  merge pipe purge json_exists json_value json_query
  json_object json_array
  06550. 00000 -  &quot;line %s, column %s:\n%s&quot;
  *Cause:    Usually a PL/SQL compilation error.
  *Action:</p>