> I was wondering if and how I could query multiple > datasources, essentially a simple join on two different > datasources? I have tables in Oracle and MySQL databases and > I want to query info from both for a return set.
The easiest way to do this is to use CF's query-of-query functionality, which allows you to treat existing recordsets as if they were tables within a database: <cfquery name="qOracle" datasource="my_oracle_db"> SELECT field1, field2 FROM table1 </cfquery> <cfquery name="qMySQL" datasource="my_mysql_db"> SELECT field3, field4 FROM table2 </cfquery> <cfquery name="qCF" dbtype="query"> SELECT qOracle.field2, qMySQL.field3 FROM qOracle, qMySQL WHERE qOracle.field1 = qMySQL.field3 </cfquery> You may also be able to connect to one database from within the other, although this will depend on the specifics of your databases and your network configuration. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241244 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

