返回结果集的存储过程实例及调用
来源:互联网 发布:12345数字打字软件 编辑:程序博客网 时间:2024/05/22 08:03
1、创建一个包,定义一个游标类型,为存储过程的输出参数使用
create or replace package sp_emp_pk astype sp_emp_cursor is ref cursor;end sp_emp_pk;/
2、创建返回结果集的存储过程
create or replace PROCEDURE sproc_cursor(deptnum in number,emp_cursor out sp_emp_pk.sp_emp_cursor) isbeginopen emp_cursor for select ename,sal from emp where deptno=deptnum;end sproc_cursor;/
3、返回结果集的存储过程的调用
declare type sp_emp_cursor is ref cursor;emp_cursor sp_emp_cursor;--v_empno emp.empno%type:=7839;v_deptno emp.deptno%type:=10;v_ename emp.ename%type;v_sal emp.sal%type;beginsproc_cursor(v_deptno,emp_cursor);loopfetch emp_cursor into v_ename,v_sal;exit when emp_cursor%notfound;--sp_pro8(v_empno,v_ename);dbms_output.put_line(v_ename);end loop;--dbms_output.put_line('Hello world');close emp_cursor;end;/
0 0
- 返回结果集的存储过程实例及调用
- 返回结果集的存储过程 及调用sys_refcursor--结果集
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- c#调用oracle存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- C#调用ORACLE存储过程返回结果集及函数
- LCD控制器
- hpuoj 1714: 感恩节KK专场——送给新生的礼物 【大水】【校赛】
- javaScript中数据类型,$ is not a function问题
- 11月—快乐英语
- 代理登录,token,ticket
- 返回结果集的存储过程实例及调用
- Android 自定义控件
- php+mysql
- 【Educational Codeforces Round 2C】【贪心】最少修改数下得到字典序尽可能小回文串
- openstack之neutron代码分析---(1)neutron初始化流程
- 转载:linux 内存管理——内核的shmall 和shmmax 参数
- Remove Duplicates from Sorted Array II
- 今天来打打java大数模板(整型)
- Android UICC 好文关键字备忘