DB2 转Oracle
DB2 转Oracle
某天是星期几的函数
DB2:
select a.yyxe,a.zblb,a.ysdm,a.daynum,b.zjxm from zy_yspb a ,zy_zjlb b where a.ysdm=b.id and a.ksdm=10000 order by abs( a.daynum -DAYOFWEEK(current date)+1) desc,a.daynum,a.zblb
sql.executeQuery:ORA-00936: 缺失表达式
Oracle :
select a.yyxe,a.zblb,a.ysdm,a.daynum,b.zjxm from zy_yspb a ,zy_zjlb b where a.ysdm=b.id and a.ksdm=10000 order by abs( a.daynum -to_char(sysdate,'D')+1) desc,a.daynum,a.zblb
to_char 和to_date的用法
DB2:
select count(*) as yyrs from zy_zzd where zblb=2 and zzys=10000 and zzrq >='2009-08-21 00:00:00' and zzrq <='2009-08-21 23:59:59' and -DAYOFWEEK(current date)-1=2
Oracle :
select count(*) as yyrs from zy_zzd where zblb=2 and zzys=10000 and zzrq >=to_date('2009-08-21 00:00:00','yyyy-mm-dd hh24:mi:ss') and zzrq <=to_date('2009-08-21 23:59:59','yyyy-mm-dd hh24:mi:ss') and to_char(zzrq,'D')-1=2
ZCJGMC,ZRJGMC,SHYSMC,ZRKSMC,CARDID,ZCKSMC
相关文档:
转自:http://www.oracle.com/technology/obe/obe9ir2/obe-cnt/plsql/plsql.htm
都说读书不求甚解害死人,一点也不错,最近我从网上淘到关于ORACLE如何从数据库目录下读文件,于是就用于生产了,结果上了生产,程序死活就是跑不出来,原因是我们的服务器做了REC,如果在两台机器上找一个目录呢,以前呢在自己的程序里把路� ......
Oracle 向一个表中插入数据的两种方式:
Conventional Insert Operations:传统插入会优先使用高水位之下,会保证数据应用完整性:高水位之下是指:删除之后的剩余空间,高水位之上是指:从来没有用过的处女块。
Direct-path Insert Operatio ......
强制切换重做日志
ALTER SYSTEM SWITCH LOGFILE; 强制产生检查点
ALTER SYSTEM CHECKPOINT; 间接产生检查点(设定实例恢复时间不超过mm秒,亦即执行检查点之后运行超过这个时间就再次执行检查点)
ALTER SYSTEM SET FAST_START_MTTR_TARGET = 秒数; 获取重做日志文件信息
SELECT group#, ......
http://www.ej38.com/showinfo/Oracle-108709.html
Oracle 10g statistic数据统计,Oracle会根据这些统计信息来决定是走RBO(Rule-BasedOptimization),还是走CBO(Cost-BasedOptimization),会去选择哪种执行计划更划算,影响是否走相关的索引等.如果是CBO的话,它依靠准确的(或者说比较准确的)统计信息来产生优化的� ......