title: how do I use if condition in cursor because our professor don't allow us use where clause in the select statement
body: <p>Our question is showing all the countries that have names that are exactly 5 letter long. This is the cursor code and I want add if condition into it.</p>
  
  <pre><code>declare
  cursor cursor_full is select * from country_cont;
  begin
  for counter in cursor_full 
  loop 
  dbms_output.put_line(counter.country|| ' ' || counter.continent);
  end loop; 
  end;
  </code></pre>
  
  <p>However my professor said that you can't using where clause within the select statement and you should display all the countries and continent.</p>
  
  <p>so i tried this code:</p>
  
  <pre><code>declare
  country varchar(50);
  cursor cursor_full is select * from country_cont;
  begin
  if length(country)=5 then
  for counter in cursor_full 
  loop 
  dbms_output.put_line(counter.country|| ' ' || counter.continent);
  end loop; 
  end if;
  end;
  </code></pre>
  
  <p>the script output show that PL/SQL procedure successfully completed but nothing return in DBMS output</p>
  
  <p>Hope someone can help me, I spent whole night to think about it,please!</p>