Monday, September 20, 2010

Sample pl sql block

set serverout on
declare
a int;
b int;
begin
select count(1) into a from dual;
select count(1)+1 into b from dual;
dbms_output.put_line('A = '||a|| ' B = '||b);
end;
/

var rc refcursor
declare
rs sys_REFCURSOR;
Begin
open rs for select * from dual;
:rc := rs;
end;
/
print rc

No comments:

Post a Comment