?
Solved

Error querying table in multiple databases

Posted on 2010-09-12
2
Medium Priority
?
374 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

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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

770 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