You are on page 1of 1

/* create or replace package emp_data as type emp_cur_typ is REF CURSOR return employees%rowtype; procedure open_emp_cur_var (emp_cur_var in out emp_cur_typ,

your_choice in number); end; / create or replace package body emp_data as procedure open_emp_cur_var (emp_cur_var in out emp_cur_typ, your_choice in n umber) is begin if your_choice = 1 then open emp_cur_var for select * from employees; elsif your_choice = 2 then open emp_cur_var for select * from employees where salary > 10000; else dbms_output.put_line('Choice must be 1 or 2 only'); -end; / */ --variable cv refcursor --execute emp_data.open_emp_cur_var(:cv, 1); --set serveroutput on --print cv end if; close emp_cur_var; end;

You might also like