游标使用—return
来源:互联网 发布:apk文件数据库提取 编辑:程序博客网 时间:2024/06/18 15:23
游标使用
在游标中要想只是显示一条结果,则可用return返回。
declare
cursor c_copy_dept(c_dept_id number) is
select dp.department_name from bi_pub.dim_department dp
where dp.department_id=c_dept_id;
c_dept c_copy_dept%rowtype;
begin
open c_copy_dept(2001);
fetch c_copy_dept into c_dept;
while c_copy_dept%found loop
dbms_output.put_line('re'||c_dept.department_name);
return;
end loop;
end;
在游标中,可以把游标的取值赋给申明的一个变量。
declare
v_name varchar(50);
cursor c_copy_dept(c_dept_id number) is
select dp.department_name from bi_pub.dim_department dp
where dp.department_id=c_dept_id;
c_dept c_copy_dept%rowtype;
begin
open c_copy_dept(2001);
fetch c_copy_dept into c_dept;
while c_copy_dept%found loop
v_name:=c_dept.department_name;
dbms_output.put_line('re'||v_name);
return;
end loop;
end;
- 游标使用—return
- return使用
- 使用游标
- 游标使用
- 游标使用
- 使用游标
- 使用游标
- 游标使用
- 使用游标
- 游标使用
- 游标使用
- 游标使用
- 游标使用
- 游标使用
- 游标使用
- 游标使用
- 游标使用
- 游标使用
- Oracle分分页查询格式
- window.open
- C 获取编译日期函数
- C++ STL简介
- javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String
- 游标使用—return
- 统计表结构中的列数
- HDU 1251 求前缀
- Qt Windows下链接子系统与入口函数(终结版)
- linux下查看16进制文件的方法
- 666666666666.com路路解密破解游戏第一部23题攻略
- AT指令简编
- org.hibernate.hql.ast.QuerySyntaxException:user is notmapped
- IO_STACK_LOCATION说明