tracker issue : CF-4206999

select a category, or use search below
(searches all categories and all time range)

Error when composing cfstoredproc invocations on stored procedures from different databases and schemas

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Ezequiel G. / ()

Created: 02/10/2020

Components: Database, JDBC

Versions: 2016

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: 2016,0,13,316217 /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Win 2016

Vote Count: 0

Problem Description:
Composing cfstoredproc invocations on stored procedures that are defined in different databases and different schemas does not work.

Steps to Reproduce:
1. In a CFC component, define a function (foo) that invokes a cfstoredproc with a parameter where the value is the result of another function (bar).
2. Define another cfstoredproc in function bar() where the datasource and schema names are different of those used in  function foo. 
3. Call function foo()

Actual Result:
ERROR.Diagnostics:Error Executing Database Query. [Macromedia][SQLServer JDBC Driver][SQLServer]Could not find stored procedure ....

Expected Result:
Execute both functions/stored procedures and get the result. 

Any Workarounds:
Yes, the workaround is to use an intermediate variable to prevent composing cfstoredproc invocations that are in different dbs, schemas.



The workaround is to modify foo function as: <cffunction name="foo" access="public" returntype="query"> <cfset var bar = bar() /> <cfstoredproc datasource="dsFoo" procedure="[wahoo].[Foo]"> <cfprocparam cfsqltype="cf_sql_bit" dbvarname="@barId" value="#bar#"> <cfprocresult name="queryResult"> </cfstoredproc> <cfreturn queryResult> </cffunction>
Comment by Ezequiel G.
32101 | February 11, 2020 01:48:22 PM GMT