out参数以及使用光标问题
来源:互联网 发布:分页查询sql语句 编辑:程序博客网 时间:2024/05/19 21:42
/*
查询某个员工的姓名 月薪 职位
*/
create or replace procedure queryEmpInfo(eno in number,
pename out varchar2,
psal out number,
pjob out varchar2)
as
begin
select ename,sal,empjob into pename,psal,pjob from emp where empno=eno;
end;
/
–光标: 使用游标查询员工姓名和工资,并打印
/*
光标的属性:
**%isopen 是否被打开
%rowcount 行数
%notfound 是否有值**
*/
set serveroutput on
declare
–光标
cursor cemp is select ename,sal from emp;
pename emp.ename%type;
psal emp.sal%type;
begin
open cemp;
loop
–从集合中取值
fetch cemp into pename,psal;
–**
exit when cemp%notfound;
dbms_output.put_line(pename||'的薪水是'||psal);
end loop;
close cemp;
end;
/
查询某个部门中所有员工的所有信息
CREATE OR REPLACE
PACKAGE MYPACKAGE AS
type empcursor is ref cursor;
procedure queryEmpList(dno in number,empList out empcursor);
END MYPACKAGE;
CREATE OR REPLACE
PACKAGE BODY MYPACKAGE AS
procedure queryEmpList(dno in number,empList out empcursor) AS
BEGIN
open empList for select * from emp where deptno=dno;
END queryEmpList;
END MYPACKAGE;
- out参数以及使用光标问题
- Oracle学习-光标类型的out参数
- Oracle在out参数中访问光标
- 引用参数(ref)以及输出参数(out)
- Keil 3光标问题 以及汉字问题
- params,ref,out 参数问题
- 使用ref和out参数
- 使用Out参数返回数据
- 使用ref和out参数
- out 参数类型的使用
- ref 和out以及params参数详解
- c#中ref和out参数使用时需要注意的问题
- c#中ref和out参数使用时需要注意的问题
- C#中ref和out参数使用时需要注意的问题
- 方法参数ref,out的问题!
- Out 类型参数引发的问题
- MethodInfo.Invoke如何使用out ref参数
- C# 下ref和out 参数使用
- java-oracle数据库连接
- php Linux安装
- centos7中控制节点配置网络
- 【获奖公告】有奖试读—增长黑客
- c#多表连接查询配合case和then使用
- out参数以及使用光标问题
- MySQL自带压力测试工具mysqlslap基本使用
- Android:系统自己附带的图片
- centos7中控制节点配置网络
- 浅谈jsp、freemarker、velocity区别
- IT优秀书籍收集下载
- 【Unity3D游戏开发】System.Collections.Generic.ICollection`1.CopyTo 错误 (二三)
- Pluto中文文本分析能力的数据挖掘平台
- JAVA 创建文件和文件夹,删除文件和文件夹,复制文件和文件夹,移动文件和文件夹的实用工具类