Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting a Return Value from an Oracle Function

Status
Not open for further replies.

MikeLacey

MIS
Nov 9, 1998
13,212
GB
We're having a bit of trouble getting a return value from an Oracle Function.<br><br>The function works fine, inserts into a couple of tables and returns a string value.<br><br>How do I get at that returned value in CF?<br><br>This is what we have at the moment:<br><br>&lt;FONT FACE=monospace&gt;<b><br>&lt;cfquery name="CallCre8QWO" datasource="MAX_PROD"&gt;<br>{<br> call maximo.cre8qwo(<br> 'WAPPR',<br>                'CARGILL',<br>                'Something',<br>                '88000',<br>                'BROCKLB',<br>                5,<br>                7,<br>                5,<br>                'FACILITY'<br> )<br>}<br>&lt;/cfquery&gt;<br>&lt;cfoutput "CallCre8QWO"&gt;<br>&lt;/cfoutput&gt;<br>&lt;/font&gt;</b><br><br>All help greatly appreciated - we're working on this right now so any quick response would be appreciated. I've got this post marked to notify me via e-mail.<br><br>Thanks.
 
from the doc ...<br><br>&lt;CFSTOREDPROC PROCEDURE=&quot;maximo.cre8qwo&quot; ...&gt;&nbsp;&nbsp;<br>&nbsp;&nbsp;&lt;CFPROCPARAM TYPE=&quot;IN&quot; ...&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&lt;CFPROCPARAM TYPE=&quot;OUT&quot; CFSQLTYPE=... CFVARNAME=FOO DBVARNAME=...&gt;&nbsp;&nbsp;<br>&lt;/CFSTOREDPROC&gt;&nbsp;&nbsp;<br><br>&lt;CFOUTPUT&gt;<br>The output param value: '#foo#'<br>&lt;/CFOUTPUT&gt;
 
Thx Iza - works exactly as you said.<br><br>I notice that it only works with procedures though - you can't call a function directly.<br><br>Anyway - problem solved.<br> <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
I'am having a trouble getting a return value from an Oracle Function.

This is function works fine:

function SIFRANT (val IN CHAR, sif IN CHAR)
return CHAR
as
tkst CHAR;
Begin
End;

How do I get at that returned value in CF?

Thanks.



 
actually the cfstoredproc DOES work for functions, i've used it this way
as far as i remember, you have to specify you're expecting a return value ( in the <cfstoredproc ...> tag) and you retrieve it thru cfstoredproc.returnvalue or something
well there was a good example in the doc ... it must be still there, you can check
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top