Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
SQL
create or replace function abc(edf sys_refcursor)

SQL
create or replace function abc(edf in function)


Sorry about my lack of knowledge, but is this possible?
Posted
Comments
Jörgen Andersson 21-Sep-14 17:30pm    
A function is not a type.
If you want to use the result of one function as the in parameter of an other function, it is quite possible to do so if the result is of the same type as the in parameter.

1 solution

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 and next replace it with parameter value:
stmt:=replace(stmt,'$parm','''value''');

I use very complicated code like this, it works fast, and reliable (remember, that, for instance $, . or ' signs are keywords in pattern above).

Maybe, it's possible to use object types with methods in Your case, but I didn't do it.

Using SYS_REFCURSOR works ok in local database, but very slow through database links. Next, it's hard to find cursor result fields.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900