oracle自定义异常
2016-04-06 09:32
627 查看
1.弹出错误框:
示例代码:
执行结果:
2.控制台显示:
示例代码:
执行结果:
示例代码:
declare v_count number; begin select count(*) into v_count from dept; if v_count < 10 then raise_application_error(-20001,'数量小于10'); end if; end;
执行结果:
2.控制台显示:
示例代码:
declare v_count number; my_exp exception; begin select count(*) into v_count from dept; if v_count < 10 then raise my_exp; end if; exception when my_exp then dbms_output.put_line('数量小于10'); when others then dbms_output.put_line('其他异常'); end;
执行结果:
相关文章推荐
- Oracle创建表空间、创建用户以及授权、查看权限
- Oracle导入脚本文件乱码问题
- [数据库] Navicat for Oracle基本用法图文介绍
- oracle中imp导入数据中文乱码问题(转)
- 详解Oracle自定义异常示例
- Oracle instr
- oracle 不走索引
- oracle表空间管理
- Oracle 导入 IMP-00058错误及其他
- Navicat for Oracle Cannot load OCI DLL,126
- 彻底卸载oracle数据库
- oracle物理dg状态检查
- oracle 性能调优之数据库中的常见性能问题
- oracle数据库优化
- Windows8上面安装Oracle11g时,安装程序报错:[INS-13001]环境不满足最低要求
- Oracle Study之-AIX6.1构建Oracle 11gR2 RAC(1)
- Oracle Study之-AIX6.1构建Oracle 11gR2 RAC(1)
- oracle到底能不能insert into 多个values!?
- oracle SELECT INTO 和 INSERT INTO SELECT 两种表复制语句详解
- Oracle Multitenant Option - 12c Frequently Asked Questions