gpt4 book ai didi

oracle - 如何运行程序?

转载 作者:行者123 更新时间:2023-12-04 00:40:59 25 4
gpt4 key购买 nike

这里的包..

CREATE OR REPLACE PACKAGE G_PKG_REFCUR AS
TYPE rcDataCursor IS REF CURSOR;
END;

让我们考虑 PROC..
Create procedure gokul_proc(
pId in number,
pName in varchar2,
OutCur OUT G_PKG_REFCUR.rcDataCursor ) is
BEGIN
Open OutCur For
select * from gokul_table ob
where ob.active_staus-'Y' AND ob.id=pId AND ob.name=pNname;
END;

这是我的问题:我怎样才能执行这个程序?

如果没有 OutCur 参数,那么我可以像这样执行..
EXEC gokul_proc(1,'GOKUL');

但是,问题是 OutCur。我不知道在这里传递哪个值。

例如
EXEC gokul_proc(1,'GOKUL', ??????);

我只需要知道要作为过程参数传递的值。

最佳答案

在 SQL Plus 中:

VAR rc REFCURSOR
EXEC gokul_proc(1,'GOKUL', :rc);
print rc

关于oracle - 如何运行程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/839154/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com