title: Constants in Oracle SQL query
body: <p>I am new to Oracle (though familiar with SQL) and have to write a fairly complex query where a value derived from the current date is used many times.  Rather than calculate the value each time, it would seem obvious to declare a constant for the purpose.</p>
  
  <p>However, when I then try to use my DateIndex constant in the subsequent SELECT statement (which I wish to return values based on "DateIndex"), the parser tells me that it is exepcting SELECT INTO.</p>
  
  <p>What I have (simplified to the lowest form) is...</p>
  
  <pre><code> DECLARE DateIndex CONSTANT NUMBER(10,0) := 24;
  
   BEGIN
        SELECT DateIndex
        FROM DUAL;
  END;
  </code></pre>
  
  <p>Is it only possible to use constants when selecting into a table rather than returning results?  Seems very odd. </p>
  
  <p>Note that I do <strong>not</strong> have write permissions on the database.</p>
  
  <p>Many thanks for any assistance.</p>