Skip to main content
October 26, 2011
Question

Get the return value from Stored Procedure

  • October 26, 2011
  • 1 reply
  • 1821 views

Hi,

I have a stored procedure (e.g. sp_get_num) and it returns a integer number using the following statement:

RETURN 0; -- for error flag

However, when I use the following coldfusion statement to get the return value, I encounter some problems.

<cfstoredproc procedure="sp_get_num" datasource="#application.ds#" returnCode="yes">

  <cfprocresult name="searchResults">

  </cfstoredproc>

Now, I can only get the result of #searchResults.RecordCount# correctly. But, I still do not have idea on getting the return value. How can I get the return value?

This topic has been closed for replies.

1 reply

Inspiring
October 26, 2011

I would start with the documentation on cfstoredproc. It mentions populating a statusCode variable.

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d55.html