Copy link to clipboard
Copied
When using the cfstoredproc tag I am not seeing the status code being set when the returncode attribute is set to 'Y'. Below is the code that calls the stored procedure. I am running on ColdFusion 2016 developer addition and my database is DB2 10.5.
<cfstoredproc procedure="NULLID.APP_PE_USRCHK" datasource="#MM_connCFWorking_DSN#" username="#MM_connCFWorking_USERNAME#" password="#MM_connCFWorking_PASSWORD#" debug="yes" returncode="yes">
<cfprocparam type="IN" value="#attributes.USERID#" cfsqltype="CF_SQL_VARCHAR">
<cfprocparam type="INOUT" value="#app_pe_userchk__ISAUTHORIZED#" variable="app_pe_userchk__ISAUTHORIZED" cfsqltype="CF_SQL_CHAR">
</cfstoredproc>
<cfdump var="#cfstoredproc#" >
<cfset caller.app_pe_userchk__isauthorized = #trim(app_pe_userchk__ISAUTHORIZED)#>
<cfoutput>
cfstoredproc.statuscode: #cfstoredproc.statuscode#<br>
app_pe_userchk__ISAUTHORIZED: #app_pe_userchk__ISAUTHORIZED#<br>
</cfoutput>
<cfif CFSTOREDPROC.STATUSCODE neq 0>
<cfthrow message="No app_pe_userchk performed">
</cfif>
The output from the cfdump of the cfstoredproc is below.
struct | |
---|---|
ExecutionTime | 4 |
StatusCode | [empty string] |
Have something to add?