title: Passing variable to a Select query in Oracle
body: <p>I am working on Oracle 11g Db, Having trouble on writing Oracle syntax.</p>
  
  <p>I am trying to pass a number variable to my select query and populate the select query to a cursor.</p>
  
  <pre><code>Declare yr_nr NUMBER;
  Begin
  yr_nr := 2014;
  SELECT DCD.CCY ID, DCD.CCYCDDSC DSC
   FROM CCYDCD DCD, CCYEXC EXC
   WHERE DCD.CCY = EXC.CCY
   AND EXC.YEARNR = yr_nr
  End
  </code></pre>
  
  <p>This select query returns 80 records. How to rewrite this syntax.</p>