接收refcursor的函数和接收另一个函数作为参数的函数有什么区别? [英] What are the differences about a function which recieve a refcursor and a function which recieves another function as a parameter?

查看:64
本文介绍了接收refcursor的函数和接收另一个函数作为参数的函数有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道一般用途的明确定义。我想知道哪个更好用,在什么情况下其中一个可以替换另一个方法。



谢谢

I want to know a clear definition about it for general purposes. I want to know which is better to use and in what cases one of them can replace to the other method.

Thanks

create or replace function abc(edf sys_refcursor)




create or replace function abc(edf in function)





对我缺乏知识感到抱歉,但这可能吗?



Sorry about my lack of knowledge, but is this possible?

推荐答案

Oracle中没有函数类型。在这种情况下,我将字符串参数与函数模式,包,名称,参数等一起使用,并使用 EXECUTE IMMEDIATE 语句执行它。可以使用参数掩码,例如。
There's no function type in Oracle. In such cases I use string parameter with function schema, package, name, parameters, etc. and execute it with EXECUTE IMMEDIATE statement. It's possible to to use parameter masks eg.


parm 然后用参数值替换它:

parm and next replace it with parameter value:
stmt:=replace(stmt,'


parm','''value''');
parm','''value''');



我使用非常复杂的代码,它运行速度很快,可靠的(请记住,例如


I use very complicated code like this, it works fast, and reliable (remember, that, for instance


这篇关于接收refcursor的函数和接收另一个函数作为参数的函数有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆