CFQUERY更新内部连接来自不同服务器的两个表

时间:2017-08-08 16:14:16

标签: mysql coldfusion cfquery

我有这个更新声明 -

<cfquery name="updateqry" datasource="thisone">
    update dbOne.tableA a
    inner join dbTwo.tableB b on a.docid=b.docid
    set a.download_dt = now(), a.document_status = "DOWNLOADED", a.rec_mod_dt = now()
    where b.school_id = <cfqueryparam value="#project.school_id#">
    and b.project_id = <cfqueryparam value="#arguments.project_id#">
    and date(b.doc_add_dt) >= <cfqueryparam value="#arguments.begin_dt#">
    and date(b.doc_add_dt) <= <cfqueryparam value="#arguments.end_dt#">
    and a.download_dt is null and a.document_status <> "DOWNLOADED"
</cfquery>

dbOne和dbTwo现在位于不同的服务器上。如何将此更新语句分成多个语句,以便从每个单独的服务器表中获取所需的信息?我之前从未见过这种更新内连接语法,我真的很难过。

0 个答案:

没有答案