1:首先定义一个简单的包
create or replace package p1 is
procedure pro_p1;
Type p1_cursor is ref cursor;
end p1;
2:然后编写该包下的存储过程
create or replace package body p1 is
procedure pro_p1 is
--定义
s varchar2(100);
p1_cursor is select ename from emp;
begin
for loop_cursor in t loop
dbms_output.put_line(loop_cursor.ename);
end loop;
exception
when no_data_found then
null;
end;
end p1;
PLS-00103: 出现符号 "IS"在需要下列之一时: constant exception <an identifier> <a double-quoted delimited-identifier> table LONG_ double ref char time timestamp interval date binary national character nchar
我的问题1:哪里的错误?
2:能总结一下游标可以定义的位置和使用方法吗?
我见过两种:cursor 游标名 is select 语句 写在declare内部
通过函数参数传入进来,然后使用open 游标 for select 语句
眼眸繁星
慕盖茨4494581
扬帆大鱼
相关分类