create or replace package test12 is
type Mycursor is ref cursor;
procedure p_test(cursor1 out mycursor);
end test12;
/create or replace package body test12 is
procedure p_test(cursor1 out mycursor) as
p_sql varchar(2000);
begin
p_sql:='SELECT id FROM tbl1';
open cursor1 for p_sql;
end p_test;
end test12;
/存储过程已经写好,但是如何定义一个游标,以取得存储过程的返回值cursor1。请各位指教,谢谢。
type Mycursor is ref cursor;
procedure p_test(cursor1 out mycursor);
end test12;
/create or replace package body test12 is
procedure p_test(cursor1 out mycursor) as
p_sql varchar(2000);
begin
p_sql:='SELECT id FROM tbl1';
open cursor1 for p_sql;
end p_test;
end test12;
/存储过程已经写好,但是如何定义一个游标,以取得存储过程的返回值cursor1。请各位指教,谢谢。
解决方案 »
- 问个弱智的问题,rman恢复目录数据库是实时运行的吗
- oracle数据库启动错误
- 跪问:数据的恢复
- 一个处理字符串的sql,请教一下,错在哪里?
- 谁知道这是怎么回事?
- 我有两台服务器(win2000 advanced server),一个磁盘阵列,装oracle9i。怎么装?
- Oracle数据库 v$sqlarea , v$session , v$process 中分别可以保留多长时间的资料 ?
- 查询到的数据重复
- ORACLE在WIN2000上的内存不断增大,是否正常?(100分)
- 分区查询比较慢,如何优化分区查询速度
- 能不能将这2个触发器合并成一个触发器???
- 请问怎样将数字转化成日期????
id number;
cursor1 test12.Mycursor;
begin
test12.p_test(cursor1);
loop
fetch cursor1 into id;
exit when cursor1%notfound;
dbms_output.put_line(id);
end loop;
end;