title: Cursor Declaration in ELSE IF block in mysql?
body: <p>i want know, <strong>can we declare cursor in ELSE IF block</strong>?
  when i do this i found error 
  <strong>missing  subclause or other element before 'declare'</strong> .my code is</p>
  
  <pre><code> if State is NOT NULL
      then
      declare t cursor for select *from student;//this line has error 
      declare continue handler for NOT FOUND set str=1;
      else
      declare t cursor for select *from student;
      end if;
  </code></pre>
  
  <p>why??</p>