oracl 和db2 常用语法比较: 1、取前N条记录 Oracle:Select * from TableName where rownum <= N; DB2:Select * from TableName fetch first N rows only; 2、取得系统日期 Oracle:Select sysdate from dual; DB2:Select current timestamp from sysibm.sysdummy1; 3、空值转换 Oracle:Select
ORACLE 用户自定义异常小例子
1.进入pl/sql测试窗口
2.执行语句
declare
empname varchar2(255);
customize_exp EXCEPTION; –自定义异常
begin
FOR c IN (select d.* from scott.dept d) LOOP
begin
dbms_output.put_line('dept: ' || c.deptno || '=' || c.dname