coldfusion - How Can I use Two DataSources in a CFQUERY -
<cfquery name="checkinvoice" datasource="?"> select distinct invoice_date,department,value,invoice_no ro_invoice sheet_no='#newrosheet.sheetno#' minus select distinct invoice_date,department,value,invoice_no dbowner.rs_invoices rs_id ='#recordsheet.id#' </cfquery>
in above code 1st select
statement belongs datasource1
, 2nd datasource2
(in oracle). how can use cfquery execute 2 statements?
if both databases oracle (it isn't clear in question) can create database link , query both databases if one. link done in oracle "coldfusion solution" isn't required. oracle has documentation on linking databases here. accessing , modifying information in multiple databases we've used several times during data migration legacy new systems. works well. can use insert
, update
, , delete
once tables linked using easy, using @dblink syntax.
<cfquery ...> select a.column1 , b.column2 sometable@dblinkname -- came linked database inner join someothertable b on b.somecolumn = a.somecolumn </cfquery>
Comments
Post a Comment