oracle 游标使用
来源:互联网 发布:pp盘古越狱mac 编辑:程序博客网 时间:2024/05/29 09:13
declare
type dept_table is table of dept%rowtype index by binary_integer;
dept_tb dept_table;
cursor dept_cursor is select * from dept;
begin
open dept_cursor;
fetch dept_cursor bulk collect into dept_tb;
close dept_cursor;
for i in dept_tb.first..dept_tb.last loop
dbms_output.put_line(dept_tb(i).deptno);
end loop;
end;
declare
v_dept dept%rowtype;
cursor dept_cursor is select * from dept ;
begin
open dept_cursor;
loop
fetch dept_cursor into v_dept;
exit when dept_cursor%notfound;
dbms_output.put_line('编号:'||v_dept.deptno);
end loop;
close dept_cursor;
end;
declare
dept_row dept%rowtype;
cursor dept_cursor is select * from dept;
begin
open dept_cursor;
loop
fetch dept_cursor into dept_row;
exit when dept_cursor%notfound;
dbms_output.put_line(dept_row.deptno);
end loop;
close dept_cursor;
end;
declare
type dept_table is table of dept%rowtype index by binary_integer;
dept_tb dept_table;
cursor cursor_dept is select * from dept;
begin
open cursor_dept;
fetch cursor_dept bulk collect into dept_tb;
close cursor_dept;
for i in dept_tb.first..dept_tb.last loop
dbms_output.put_line(dept_tb(i).deptno);
end loop;
end;
declare
begin
for one in (select * from dept) loop
dbms_output.put_line(one.deptno);
end loop;
end;
create or replace procedure proce_in(v_empno in emp.empno%type, v_ename out emp.ename%type)
begin
as
select ename into v_ename from emp where empno =v_empno;
return v_ename;
exception
when no_data_found then dbms_output.put_line('输入有误,请核对');
end;
type dept_table is table of dept%rowtype index by binary_integer;
dept_tb dept_table;
cursor dept_cursor is select * from dept;
begin
open dept_cursor;
fetch dept_cursor bulk collect into dept_tb;
close dept_cursor;
for i in dept_tb.first..dept_tb.last loop
dbms_output.put_line(dept_tb(i).deptno);
end loop;
end;
declare
v_dept dept%rowtype;
cursor dept_cursor is select * from dept ;
begin
open dept_cursor;
loop
fetch dept_cursor into v_dept;
exit when dept_cursor%notfound;
dbms_output.put_line('编号:'||v_dept.deptno);
end loop;
close dept_cursor;
end;
declare
dept_row dept%rowtype;
cursor dept_cursor is select * from dept;
begin
open dept_cursor;
loop
fetch dept_cursor into dept_row;
exit when dept_cursor%notfound;
dbms_output.put_line(dept_row.deptno);
end loop;
close dept_cursor;
end;
declare
type dept_table is table of dept%rowtype index by binary_integer;
dept_tb dept_table;
cursor cursor_dept is select * from dept;
begin
open cursor_dept;
fetch cursor_dept bulk collect into dept_tb;
close cursor_dept;
for i in dept_tb.first..dept_tb.last loop
dbms_output.put_line(dept_tb(i).deptno);
end loop;
end;
declare
begin
for one in (select * from dept) loop
dbms_output.put_line(one.deptno);
end loop;
end;
create or replace procedure proce_in(v_empno in emp.empno%type, v_ename out emp.ename%type)
begin
as
select ename into v_ename from emp where empno =v_empno;
return v_ename;
exception
when no_data_found then dbms_output.put_line('输入有误,请核对');
end;
0 0
- Oracle 游标使用大全
- Oracle 游标使用大全
- Oracle 游标使用
- oracle 游标使用
- Oracle 游标使用大全
- Oracle数据库游标使用
- oracle游标使用
- Oracle 游标使用大全
- Oracle 游标使用大全
- Oracle 游标使用大全
- Oracle游标使用大全
- Oracle 游标使用大全
- Oracle游标使用大全
- Oracle 游标使用大全
- Oracle 游标使用大全
- Oracle游标使用大全
- oracle 游标使用大全
- oracle游标使用示例
- hi3519v101 nandflash 调试
- 关于JEE中的javax.mail 和javamail冲突问题
- Java多线程-工具篇-BlockingQueue
- Android 带角标的ImageView(微博,QQ消息提示)
- 洛谷 P1169 [ZJOI2007]棋盘制作
- oracle 游标使用
- 机器分配
- JDK并发包(concurrent)
- sqlserver安装设置小计
- 蓝桥杯——算法训练 求指数(Vip试题)
- VS开发Application生硬古怪的问题及原因汇总
- JS隐藏div占用与不占用页面位置方法
- go reflect
- Apache Commons Email邮件发送