Skip to content
January 23, 2013 / doganay

HOW TO CHECK IF A REF CURSOR RETURNS DATA FROM A PL/SQL PROCEDURE

create or replace procedure sp_is_refcursor_null (v_cursor OUT SYS_REFCURSOR)
AS
v_rec number;
BEGIN
 OPEN v_cursor FOR
  select 1 from dual where 1=0;
 fetch v_cursor into v_rec;
 if v_cursor%found then
  dbms_output.put_line('CURSOR NOT NULL');
 else
  dbms_output.put_line('CURSOR NULL');
 end if;
END;
/
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: