This is a continued question for this thread thread
I am trying to create a function not a procedure that returns cursor.
I have tried this but get compiler errors
tried everything , basically what is the syntax for returning a cursor from a function.
Also is their any difference in functionality in using a stored procedure instead of a stored function. They both can be used to return values their as in/out parameters or just a return statement (same effect)
And you can have functions and procedures in the same package so why the distinction???
The difference(s) between functions and procedures depends at least somewhat on what DB you're using. It looks like you're using Oracle; if so, see here:
Ok , other then a few facts functions and procedures can be used interchangeable.
Functions return values , procedures don't but you can get the same effect by using out , or in/out parameters.
Their are a few other distinctions but really alot of things can be written equivalent in procedures as they are in functions...etc
My problem is I am trying to figure out how I can create the equivalent FUNCTION for the Procedure example given in that thread.
Basically I want to return a result set to java using a CallableStatement that calls a stored function not a stored procedure.
And have that function return a cursor.
I am trying to return a cursor or ref cursor and not use in/out parameters that is the main goal.
I have tried using the return CURSOR , or return SYS_REFCURSOR but in the code I keep getting compiler errors for my stored function?