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 * 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
- ››oracle 中 UPDATE nowait 的使用方法
- ››Oracle ORA-12560解决方法
- ››Oracle 10g RAC 常用维护命令
- ››Oracle如何在ASM中定位文件的分布
- ››Oracle的DBMS_RANDOM.STRING 的用法
- ››oracle 外部表导入时间日期类型数据,多字段导入
- ››Oracle中查找重复记录
- ››oracle修改用户登录密码
- ››Oracle创建删除用户、角色、表空间、导入导出等命...
- ››Oracle中登陆时报ORA-28000: the account is lock...
- ››Oracle数据库在配置文件中更改最大连接数
- ››Oracle中在pl/sql developer修改表的两种方式
更多精彩
赞助商链接