Skip to main content
October 16, 2007
Answered

Calling 2 different functions, each one using a different datasource

  • October 16, 2007
  • 1 reply
  • 353 views
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



This topic has been closed for replies.
Correct answer Dan_Bracuk
In getSupplier, return the valuelist instead of the query.

1 reply

Dan_BracukCorrect answer
Inspiring
October 16, 2007
In getSupplier, return the valuelist instead of the query.
October 17, 2007
Thanks Dan!

Best regards,
Yogesh