title: how to check if a ref cursor returns data from a pl/sql procedure
body: <p>I would like to know how to check if a ref cursor returns data.</p>
  
  <p>Let's say I have the following code in a PL/SQL package:</p>
  
  <pre><code>type refcursor is ref cursor;
  
  procedure Foo(cursorresult out refcursor) is
  begin
    open cursorresult for
      select *
        from table t
        inner join t2 on t.id = t2.id
       where t.column1 is null;
  end;
  
  procedure DoSomeghingIfFooHasResults is
    curFoo refcursor;
    begin
      Foo(curSansOwner);
      if curFoo%found then
        -- Do something
      end if;
  end function;
  </code></pre>
  
  <p>This code is used in a more involved process and the query in Foo is using multiple tables. </p>
  
  <p>I need the data returned from Foo in an asp.net application, but I also need to do something when Foo finds some data.</p>
  
  <p>I want to reuse the query at a few places, but I don't think this would be a good candidate for a view.</p>
  
  <p>What would be the best way to know if Foo finds something ?</p>
  
  <p>Thanks.</p>