赞
踩
工作需要,会做一些p与o库之间转换,记录一些相应的替换
序号 | 用途 | oracle | Pgsql |
1 | 数据类型 | varchar2 | varchar |
2 | 数据类型 | number | numeric |
3 | 系统时间 | sysdate | to_char(now(), 'yyyy-mm-dd hh24:mi:ss') |
4 | 时间函数:本月第一天 | trunc(sysdate, ''mm'') | date_trunc(''month'', current_date) |
5 | 替换空值 | nvl() | coalesce() |
6 | 关键字 | Minus | except |
7 | 时间 | Systimestamp | current_timestamp |
8 | 序列使用 | 序列名.Nextval | Nextval('序列名') |
9 | 截取 | substr(id,1,5) | substr(cast(id as VARCHAR),1,5) |
10 | 转换成字符串 | to_char(123) | cast(123 as VARCHAR) |
11 | 更改表字段数据类型 | alter table 表名 modify 字段名 number(24) | alter table 表名 alter 字段名 type numeric(24) |
12:查询表在存过中
oracle:select * from all_source a where upper(text) = upper('表名')
pgsql:select proname from pg_procwhere upper(prosrc) like upper('%表名%');
13:统计存过某个步骤执行数据量(vi_step_records 变量)
oracle:vi_step_records := sql%rowcount ;
pgsql:get diagnostics vi_step_records := row_count;
未完待续~~~~
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。