WEB开发网
开发学院数据库DB2 Oracle到DB2移植解决方案 阅读

Oracle到DB2移植解决方案

 2007-10-31 16:22:30 来源:WEB开发网   
核心提示: Select a.* from bsempms a,bsdptms b where a.dpt_no=b.dpt_no(+);Select a.* from bsempms a,bsdptms b wherea.dpt_no(+)=b.dpt_no;DB2 可以这样实现?Select *

Select a.* from bsempms a,bsdptms b where a.dpt_no=b.dpt_no(+);

Select a.* from bsempms a,bsdptms b wherea.dpt_no(+)=b.dpt_no;

DB2 可以这样实现?

Select * from db2admin.bsempms right outer join db2admin.bsdptms

on db2admin.bsempms.dpt_no=db2admin.bsdptms.dpt_no;

Select * from db2admin.bsempms left outer join db2admin.bsdptms

on db2admin.bsempms.dpt_no=db2admin.bsdptms.dpt_no;

Select * from db2admin.bsempms full outer join db2admin.bsdptms

on db2admin.bsempms.dpt_no=db2admin.bsdptms.dpt_no;

7、LIKE问题

db2中谓词LIKE后边的表达式不支持字段。只支持一下类型:

A constant

A special register

A host variable

A scalar function whose operands are any of the above

An expression concatenating any of the above

在db2 9 中我做了以下的试验,  

CreatetableRRTest(pkIDVARCHAR(20)NOTNULL,unID1varchar(20)NotNULL,UnID2varchar(20),"CUSTOMER_ID"VARCHAR(6),
  "ORDER_TYPE"DECIMAL(2,0),
  "EXECUTION_TYPE"DECIMAL(2,0),
  "ORDER_DATE"VARCHAR(8),
  "ORDER_TIME"VARCHAR(6),
  "ORDER_DATETIME"TIMESTAMP,
  "SIDE"DECIMAL(1,0),
  "TRADE_TYPE"DECIMAL(1,0),
  "ORDER_AMOUNT"DECIMAL(15,2),
  "ORDER_PRICE"DECIMAL(8,4),
  TSIDvarchar(20))
  insertintoRRTest
  SELECTOrder_ID,Order_ID,Order_ID,CUSTOMER_ID,ORDER_TYPE,EXECUTION_TYPE,ORDER_DATE,ORDER_TIME,ORDER_DATETIME,SIDE,TRADE_TYPE,ORDER_AMOUNT,ORDER_PRICE,ORDER_ID
  FROMDB2INST1.Fx_OrderwhereORDER_DATE>'20070401'
  GO
  selectcount(*)FromRRTEST
  72239
  ALTERTABLE"DB2INST1".RRTest
  ADDPRIMARYKEY
  (pkID);
  CREATEUNIQUEINDEXUNIQINDXONRRTest(unID1)
  CREATEINDEXINDX002ONRRTest(unID2)
  db2"RUNSTATSONTABLEDB2INST1.RRTestONALLCOLUMNSANDINDEXESALLALLOWWRITEACCESS"
  db2connecttodb2TT
  db2+c
  select*FromRRTESTwhereTSID='20070223ORD01267732'forupdatewithRR
  select*FromRRTESTwhereTSID='20070222ORD01266302'forupdatewithRR
  select*FromRRTESTwhereTSID='20070223ORD01267732'forupdatewithRS
  select*FromRRTESTwhereTSID='20070222ORD01266302'forupdatewithRS
  select*FromRRTESTwhereunID1='20070223ORD01267732'forupdatewithRR
  select*FromRRTESTwhereunID1='20070222ORD01266302'forupdatewithRR
  select*FromRRTESTwhereunID1='20070223ORD01267732'forupdatewithRS
  select*FromRRTESTwhereunID1='20070222ORD01266302'forupdatewithRS
  select*FromRRTESTwhereunID2='20070223ORD01267732'forupdatewithRR
  select*FromRRTESTwhereunID2='20070222ORD01266302'forupdatewithRR
  select*FromRRTESTwhereunID2='20070223ORD01267732'forupdatewithRS
  select*FromRRTESTwhereunID2='20070222ORD01266302'forupdatewithRS
  select*FromRRTESTwherepkID='20070223ORD01267732'forupdatewithRR
  select*FromRRTESTwherepkID='20070222ORD01266302'forupdatewithRR
  select*FromRRTESTwherepkID='20070223ORD01267732'forupdatewithRS
  select*FromRRTESTwherepkID='20070222ORD01266302'forupdatewithRS

上一页  1 2 3 4 5  下一页

Tags:Oracle DB 移植

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接