Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

exception handling for ref cursors

782392Aug 17 2010 — edited Aug 17 2010
now i am using the follwing stored procedure ,



create or replace procedure my_proc (dept_no in number,p_cur out sys_refcursor)
is
begin
open p_cur for select * from emp where deptno=dept_no;
end my_proc;
/

Procedure created
var a refcursor
exec my_proc(10,:a);------------data available
exec my_proc(100,:a);----------data not available
which way is the best way to maintaine exception handling for the stoderd procedure.
in my java code i call this for dept_no=100 i get error,
how to use exception handling ,and which is the best way

please tell me

subbarao
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2010
Added on Aug 17 2010
8 comments
3,671 views