CF9, no hotfix, VendorErrorCode 8114, cfprocresult error converting data type
Hello, everyone.
I've got an issue that really has me scratching my head. Not sure where the issue lies, but I'll explain as best I can.
Basically, I _think_ I'm being told that one of the fields in the recordset is not being converted.
On one page, I make the following CFINVOKE:
<cfinvoke component="components.header" method="content_single" returnvariable="resultset"
dbdsn="#request.db_dsn#" dbusr="#request.db_username#" dbpwd="#request.db_password#">
<cfinvokeargument name="table" value="#url.table#">
<cfif isDefined("url.thisNav") AND len(trim(url.thisNav)) gt 0><cfinvokeargument name="pt" value="#trim(url.thisNav)#"></cfif>
<cfif isDefined("url.id") AND val(url.id) gt 0><cfinvokeargument name="id" value="#val(url.id)#"></cfif>
<cfif isDefined("url.section") AND len(trim(url.section)) gt 0><cfinvokeargument name="section" value="#trim(url.section)#"></cfif>
</cfinvoke>
Within a CFCOMPONENT in header.cfc, I have the following:
<cffunction name="content_single" access="public">
<cfargument name="dbdsn" required="yes">
<cfargument name="dbusr" required="yes">
<cfargument name="dbpwd" required="yes">
<cfargument name="pt" required="no">
<cfargument name="id" required="no">
<cfargument name="section" required="no">
<cfargument name="table" required="yes">
<cfstoredproc procedure="SRT_sp_#lcase(url.table)#_contents_single" datasource="#dbdsn#"
username="#dbusr#" password="#dbpwd#"
result="query_result">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" variable="@table" value="#lcase(table)#" maxlength="30">
<cfif isDefined("pt") AND len(trim(pt)) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" variable="@pt" value="#ucase(pt)#" maxlength="12" null="no"></cfif>
<cfif isDefined("id") AND val(id) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" variable="@id" value="#val(id)#" maxlength="10" null="no"></cfif>
<cfif isDefined("section") AND len(trim(section)) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" variable="@section" value="#trim(replace(lcase(section),'_',' ','all'))#" maxlength="20" null="no"></cfif>
<cfprocresult name="returned_result">
</cfstoredproc>
<cfreturn returned_result>
</cffunction>
Instead of the results I expect, I get the following error:
Error Executing Database Query.
| [Macromedia][SQLServer JDBC Driver][SQLServer]Error converting data type varchar to int. | |
| The error occurred in E:\xxxxxxxx\xxxxxxx\xxxx\components\header.cfc: line 17 Called from E:\xxxxxxxx\xxxxxxx\xxxx\content_view.cfm: line 24 Called from E:\xxxxxxxx\xxxxxxx\xxxx\components\header.cfc: line 17 Called from E:\xxxxxxxx\xxxxxxx\xxxx\content_view.cfm: line 24 | |
15 : <cfif isDefined("id") AND val(id) gt 0><cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" variable="@id" value="#val(id)#" maxlength="10" null="no"></cfif> | |
