title: Storing a variable in Oracle PL SQL
body: <p>I hope you can help - I'm strying to assign a date to a variable, and then call that variable in my select query. The code I'm posting is only part of what I'm strying to do, I will be calling that variable more than once. 
  I've tried to google for help, but I'm stuck on using the Select Into statement, as I've got so many selects already.</p>
  
  <pre><code>DECLARE 
      CurrMonth DATE := '27 may 2012'; -- Enter 27th of current month  
  
  BEGIN
  
  SELECT 
      a.policynumber
      ,a.cifnumber
      ,a.phid
      ,a.policystartdate
      ,b.sistartdate
      ,c.dateofbirth
      ,'28/02/2013' AS TaxYearEnd
      --Complete tax year end in the SELECT statement (once for tax year end and once for the age at tax year end)
      ,round ((months_between('28 feb 2013',c.dateofbirth)/12),8) AS AgeAtTaxYearEnd 
      ,b.sifrequency AS CurrSIFrequ
      ,b.sivalue AS CurrentSIValue
      ,b.simode AS CurrentSIMode
      ,d.anniversarydate AS CurrentAnnDate
      ,d.anniversaryvalue AS CurrentAnnValue
      ,b.ruleeffectivedate
      ,b.sistatus AS CurrentSIStatus
      ,b.paymentbranchcode AS CurrSIBranchCode
      ,b.transferaccounttype AS CurrSIAccountType
      ,b.transferaccountnumber AS CurrSIAccountNo
      ,SUM(k.unitbalance) AS unitbalance
      ,a.latestrule
  FROM fcislob.policytbl a
      ,fcislob.policysitbl b
      ,fcislob.unitholderdetailtbl c
      ,fcislob.policyanniversaryvaluetbl d
      ,fcislob.unitholderfundtbl k
  WHERE a.policynumber = b.policynumber
      AND a.policynumber = d.policynumber
      AND b.policynumber = d.policynumber
      AND a.phid = c.unitholderid
      AND a.phid = k.unitholderid
      AND c.unitholderid = k.unitholderid
      AND a.ruleeffectivedate = b.ruleeffectivedate
      AND a.ruleeffectivedate = d.ruleeffectivedate
      AND b.ruleeffectivedate = d.ruleeffectivedate
      AND a.latestrule &lt;&gt; 0
      AND c.authrejectstatus = 'A'        
      AND a.phid LIKE 'AGLA%'
      AND b.sistatus &lt;&gt; 'C'
      AND k.unitbalance &gt;0     
      AND b.transactiontype = '64'
      AND b.sistartdate &lt;= CurrMonth                                              
      AND b.sifrequency = 'M'
  
  GROUP BY a.policynumber, a.cifnumber, a.phid, a.policystartdate, b.sistartdate , c.dateofbirth,b.sifrequency, b.sivalue, b.simode, d.anniversarydate, d.anniversaryvalue, b.ruleeffectivedate,
      b.sistatus, b.paymentbranchcode, b.transferaccounttype, b.transferaccountnumber, b.policynumber, a.latestrule;
      END;
  </code></pre>