我在oracle10g中的scott方案中创建了一下一个包和过程:create or replace package testpackage
as
type test_cursor is ref cursor;
end testpackage;
create or replace procedure P_STSCORE(deptno in int,p_cursor out testpackage.test_cursor) is
begin
open p_cursor for select * from dept where deptno=deptno;
end p_stscore;请问下我应该怎样执行这个过程啊?才能返回一个结果集呢?谢谢各位大侠!
as
type test_cursor is ref cursor;
end testpackage;
create or replace procedure P_STSCORE(deptno in int,p_cursor out testpackage.test_cursor) is
begin
open p_cursor for select * from dept where deptno=deptno;
end p_stscore;请问下我应该怎样执行这个过程啊?才能返回一个结果集呢?谢谢各位大侠!
解决方案 »
- group错误
- windows 无法访问 虚拟机(linux)
- Oracle10G 监听问题
- 求助,oracle+odbc+linux!!!!!!!!!!!!!!
- 一个过程,传递一个参数进来,报错 哪位帮助看一下
- 重开的:ORA-00942和ORA-02063错误。请高手指点
- 数据库导入导出的问题(紧急!!!),高分奉送
- 怎样把execl中的数据保存到oracle数据库中
- 能不能写个sql语句
- ORA-27300: OS system dependent operation:CreateThread failed with status: 1455
- 求助高手帮忙写个SQL------急急急!!!
- 已建好的表,没有建分区,现在要建分区了,如何建,不删除表的情况下
给你个例子:
OPER@TL>select select * from test; AAA BBB
---------- ----------
1 1
2 2
3 3
3 10OPER@TL>create or replace procedure test_p(in_var number,out_var out sys_refcursor)
2 as
3 begin
4 open out_var for select * from test where aaa=in_var;
5 end;
6 /Procedure created.OPER@TL>var abc refcursor
OPER@TL>exec test_p(3,:abc)PL/SQL procedure successfully completed.OPER@TL>print :abc AAA BBB
---------- ----------
3 3
3 10OPER@TL>