快速业务通道

跨多个数据源的J2EE开发: 细节探讨 - 编程入门网

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-17
odbc_partsupp.*, ''xls'' AS ps_server   FROM odbc_partsupp; -- DROP VIEW fed_supplier; CREATE VIEW fed_supplier AS   SELECT db2_supplier.*, ''db2'' AS s_server   FROM db2_supplier UNION ALL   SELECT ora_supplier.*, ''ora'' AS s_server   FROM ora_supplier UNION ALL   SELECT odbc_supplier.*, ''xls'' AS s_server   FROM odbc_supplier; -- DROP VIEW fed_nation; CREATE VIEW fed_nation AS   SELECT db2_nation.*, ''db2'' AS n_server   FROM db2_nation UNION ALL   SELECT ora_nation.*, ''ora'' AS n_server   FROM ora_nation UNION ALL   SELECT odbc_nation.*, ''xls'' AS n_server   FROM odbc_nation; -- -- for query #3 DROP VIEW fed_customer; CREATE VIEW fed_customer AS   SELECT db2_customer.*, ''db2'' AS c_server   FROM db2_customer UNION ALL   SELECT ora_customer.*, ''ora'' AS c_server   FROM ora_customer UNION ALL   SELECT odbc_customer.*, ''xls'' AS c_server   FROM odbc_customer; -- DROP VIEW fed_orders; CREATE VIEW fed_orders AS   SELECT db2_orders.*, ''db2'' AS o_server   FROM db2_orders UNION ALL   SELECT ora_orders.*, ''ora'' AS o_server   FROM ora_orders UNION ALL   SELECT odbc_orders.*, ''xls'' AS o_server   FROM odbc_orders;

跨多个数据源的J2EE开发: 细节探讨(14)

时间:2011-04-11 IBM C. M. Saracco

附录 B. 直接数据访问的辅助表定义

我们在一个本地 DB2 Information Integrator 数据库中创建了辅助表,来保存直接对 目标数据源(Oracle、DB2 UDB 和 Excel)执行的查询所返回的中间结果集。以下是对我 们创建的每个辅助表的定义。

---------------------------------------------------- -- Temporary tables for native data access -- This assumes you already have a database connection. ---------------------------------------------------- -- for query #1 DROP TABLE temp_query1; CREATE TABLE temp_query1(p_partkey INTEGER,              p_name VARCHAR(55),              p_mfgr CHAR(25),              p_type VARCHAR(25)) DATA CAPTURE NONE; -- for query #2 DROP TABLE temp_query2; CREATE TABLE temp_query2(ps_partkey INTEGER,              s_name CHAR(25),              s_suppkey INTEGER,              min_supplycost DOUBLE) DATA CAPTURE NONE; -- for query #3 DROP TABLE temp_query3; CREATE TABLE temp_query3(c_custkey INTEGER,              c_name CHAR(25),              total_ordered DOUBLE,              num_orders INTEGER) DATA CAPTURE NONE; -- for joined query #4 DROP TABLE temp_jquery1a; CREATE TABLE temp_jquery1a(c_custkey INTEGER,               c_name VARCHAR(55),               c_phone VARCHAR(15)) DATA CAPTURE NONE; DROP TABLE temp_jquery1b; CREATE TABLE temp_jquery1b(o_custkey INTEGER) DATA CAPTURE NONE; -- for joined query #5 DROP TABLE temp_jquery2a; CREATE TABLE temp_jquery2a(c_custkey INTEGER,               c_name VARCHAR(25),               n_name VARCHAR(25)) DATA CAPTURE NONE; DROP TABLE temp_jquery2b; CREATE TABLE temp_jquery2b(o_custkey INTEGER,               o_totalprice DOU

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号