title: PL/SQL cursor with IF condition
body: <p>I Have below cursor in the code.</p>
  
  <pre><code>   CURSOR cur1
     IS
        SELECT a, b, c, d,
          FROM EMP;
  BEGIN
      --Stored procedure logic
  END
  </code></pre>
  
  <p>This curosr is getting information from EMP table.</p>
  
  <p>But I need to change is as per below</p>
  
  <blockquote>
    <ul>
    <li>There is a table (Table1) with Key Value pairs.</li>
    <li>If the Table1 value is TRUE then the cursor should be created with STUDENT table</li>
    <li>If the table1 value is FALSE then the cursor should be created with EMP table.</li>
    </ul>
  </blockquote>
  
  <p>I can check the Value in the Table1 as below</p>
  
  <pre><code>select t.value into variable1 from Table1 t where s.key='xxxxx';
  </code></pre>
  
  <p>And I want write something like</p>
  
  <pre><code>IF variable1 := 'true'
   curosr created with STUDENT
   ELSE
    curosr created with EMP
  END IF
  
  BEGIN
      --Stored procedure logic
  END
  </code></pre>
  
  <p>How to do it?</p>