Answered
Calling 2 different functions, each one using a different datasource
Hi,
I've got a problem with the query (see attached code)
When I call getSupplier from query qProducts, I get an " Error Executing Database Query - db2.tbl_product doesn't exist"
It's as if in query qProducts, the datasource seems to be db2 instead of db1 and indeed db2 doesn't contain tbl_product.
However if we set a variable e.g.
<cfset x = #getSupplier()#>
and then in query qProducts we write
where id_supplier in (#x#)
the query executes without any problem.
Can you please advise on the above problem? It is a scoping problem? Is it a problem with CF itself?
Thanks and regards,
Yogesh Mahadnac
I've got a problem with the query (see attached code)
When I call getSupplier from query qProducts, I get an " Error Executing Database Query - db2.tbl_product doesn't exist"
It's as if in query qProducts, the datasource seems to be db2 instead of db1 and indeed db2 doesn't contain tbl_product.
However if we set a variable e.g.
<cfset x = #getSupplier()#>
and then in query qProducts we write
where id_supplier in (#x#)
the query executes without any problem.
Can you please advise on the above problem? It is a scoping problem? Is it a problem with CF itself?
Thanks and regards,
Yogesh Mahadnac