title: How to check if cursor returns any records in oracle?
body: <p>I have a following stored procedure in which I have used a cursor. Depending on whether the cursor return any records or not I need to do some processing. </p>
  
  <p>But I am not sure how to check if the cursor return any records. </p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE SP_EMPLOYEE_LOOKUP_BY_EMP_ID
  (
        IN_USER_ID IN NUMBER, 
        IN_EMPLOYEE_ID NUMBER,
        IN_HC_AS_ON_DATE VARCHAR2,
        emp_cursor OUT SYS_REFCURSOR
  ) 
  IS 
  
   CURSOR employees IS 
      SELECT  * FROM EMPLOYEE e; 
  
  BEGIN    
  
  if(record exist ) then 
  
   FOR employee IN employees
    LOOP  
  
          // do something  
  
    END LOOP; 
  else if employees is empty then 
       // do something else 
  
  END;
  </code></pre>