CREATE OR REPLACE PROCEDURE abcde(mgr in number)
as
  type t_pubapplyrow  is record(
  v_empno  number(4),
  v_ename  varchar2(10)
 );
  v_mgr emp.mgr%type;
  type cur_test is ref cursor;
  emp_cur cur_test;
  v_var t_pubapplyrow;
BEGIN
  v_mgr:=mgr;
  OPEN emp_cur FOR  select empno,ename from emp where  mgr in(select distinct mgr from emp);
  loop
  fetch emp_cur into v_var;
  exit when emp_cur%notfound;
  insert into temp_tbl(empno,ename) values(v_var.v_empno,v_var.v_ename);
  end loop;
  close  emp_cur;
  commit;
exception
 when others then
 rollback;
end;


 

相关文章:

  • 2021-06-10
  • 2021-07-06
  • 2022-12-23
  • 2021-12-04
  • 2021-08-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2023-03-20
  • 2021-12-31
  • 2021-10-21
  • 2021-11-22
相关资源
相似解决方案