Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Calling a stored function from PROC

Re: Calling a stored function from PROC

From: Tony Likhite <tlikhite_at_together.net>
Date: Sat, 15 Aug 1998 23:59:17 -0400
Message-ID: <35D65915.EDFE558B@together.net>


If it's a function, you have to assign it to a variable - you can't treat it like a procedure and ignore its return value, as you could in C. Try this:

EXEC SQL EXECUTE
DECLARE
/* your other declarations here */

   rc integer; /* we'll pretend ABC returns an int */ BEGIN
   rc := XYZ.ABC(:verA,:verAC);
END;
END-EXEC; -Tony-

gjs_at_hotmail.com wrote:
>
> I appreciate if any body can help me wit the following.
>
> I wrote a small function and packaged it with other procedures which
> returns and integer v_result.
>
> XYZ is package and ABC is the name of the function.
>
> This has been tested by executing a small proedure where it takes in two
> parameters and returns the result. An I am pasting the error message I
> got while compiling the C program.
>
> I am not sure how to invoke a function from the C program and capture
> the result.
>
> Now I want to call this function from within a C program. I have declare
> the variables verA and verAC in the declare sections.
>
> And executed as below.
>
> EXEC SQL EXECUTE
> BEGIN
> XYZ.ABC(:verA,:verAC);
> END;
>
> END-EXEC;
> return(v_result);
>
> returnStaus = v_result.
>
> 129 END-EXEC;
> 129 .^
> PCC-S-0061: Error at line 131, column 10. PLS-221: 'ABC' is not a
> proce
> dure or is undefined
> 129 END-EXEC;
> 129 .^
Received on Sat Aug 15 1998 - 22:59:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US