oracle中的存储过程案例
来源:互联网 发布:元数据系统作用 编辑:程序博客网 时间:2024/06/07 07:45
1、无数据查询,对游标无效
create or replace procedure noData is
v_val varchar2(100);
begin
select val1 into v_val from test where rownum = 1;
dbms_output.put_line(v_val);
exception
when no_data_found then
dbms_output.put_line('no data');
end noData;
2、嵌套的游标
create or replace procedure nestedCustor is
cursor CUR_master is
SELECT val1 from test;
cursor cur_new is
select val2 from new;
v_test varchar2(100);
v_new varchar2(100);
begin
open CUR_master;
FETCH CUR_master
into v_test;
while CUR_master%found loop
open cur_new;
fetch cur_new
into v_new;
while cur_new%found loop
dbms_output.put_line(v_new);
fetch cur_new
into v_new;
end loop;
close cur_new;
dbms_output.put_line(v_test);
FETCH CUR_master
into v_test;
end loop;
CLOSE CUR_master;
exception
when others then
dbms_output.put_line('error');
dbms_output.put_line(substr(SQLERRM, 1, 255));
if (cur_new%isopen) then
close cur_new;
end if;
if (CUR_master%isopen) then
close CUR_master;
end if;
end nestedCustor;
- oracle中的存储过程案例
- oracle 存储过程初学案例
- oracle中的存储过程
- oracle中的存储过程
- Oracle中的存储过程
- Oracle中的存储过程
- Oracle索引、视图、存储过程、触发器案例
- oracle分页存储过程编写案例
- java调用oracle存储过程案例
- oracle job 及存储过程案例
- oracle存储过程及触发器简单案例
- Oracle存储过程实战案例分享。
- Oracle存储过程基础与案例
- oracle包中的存储过程
- Oracle中的JAVA存储过程
- oracle中的存储过程初试
- Oracle中的分页存储过程
- oracle存储过程中的事务
- Qt 改变快捷方法的图标的方法
- [转]C++异常处理 5
- Java与模式 命令模式 Command Pattern
- [转]C++异常处理 6
- 用Ant编译Java Web程序
- oracle中的存储过程案例
- [转]C++异常处理 7
- 跨服务器查询
- MSDN DLL 综合
- [转]C++异常处理 8
- 微软语音开发包的丁点使用
- javascript单元测试(Jsunit应用)
- [转]C++异常处理 9
- [转]C++异常处理 10