[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Error querying table in multiple databases

Posted on 2010-09-12
2
Medium Priority
?
376 Views
Last Modified: 2012-08-13
I am trying to query the same table in multiple databases.  When my code attempts to query the second database in my list I get the following error:
        Datasource DB1 could not be found.

If I change the order in my DSNList my code always fails at the second database.  
<cfset DSNList = "db1, db2, db3">

<cfloop list="#DSNList#" index="defDSN" delimiters=",">
	<cfoutput>
	[#defDSN#]:
	</cfoutput>
	<CFQUERY NAME="getCategory" DATASOURCE="#defDSN#">
		SELECT      *
		FROM        thread_categories
	</cfquery>
	
	<br />
</cfloop>

Open in new window

0
Comment
Question by:WestCoast_BC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
js_vaughan earned 2000 total points
ID: 33657312
You will need to remove those spaces in the list.
0
 

Author Comment

by:WestCoast_BC
ID: 33657356
Thank you!  I wish I had figured that out an hour ago.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question