declare
v_tempvar number:=1;
begin
dbms_output.put_line('initial value:'||v_tempvar);
raiseerror(false,v_tempvar);
dbms_output.put_line('value after successful call:'|| v_tempvar);
v_tempvar:=2;
dbms_output.put_line('value before 2nd call:'||v_tempvar);
raiseerror(true,v_tempvar);
exception
when others then
dbms_output.put_line('value after unsuccessful call:'||
v_tempvar);
end;
结果
initial value:1
value after successful call:7
value before 2nd call:2
vaule after unsuccessful call:7请问下value after successful call:7和vaule after unsuccessful call:7
是怎么来的7???raiseerror(true,v_tempvar);这段是什么意思??
v_tempvar number:=1;
begin
dbms_output.put_line('initial value:'||v_tempvar);
raiseerror(false,v_tempvar);
dbms_output.put_line('value after successful call:'|| v_tempvar);
v_tempvar:=2;
dbms_output.put_line('value before 2nd call:'||v_tempvar);
raiseerror(true,v_tempvar);
exception
when others then
dbms_output.put_line('value after unsuccessful call:'||
v_tempvar);
end;
结果
initial value:1
value after successful call:7
value before 2nd call:2
vaule after unsuccessful call:7请问下value after successful call:7和vaule after unsuccessful call:7
是怎么来的7???raiseerror(true,v_tempvar);这段是什么意思??
解决方案 »
- 如何查询最近时间的一条记录
- oracle中做view时,怎么把case语句作为条件语句
- 高手救我
- oracle 如何实现某个用户只能查询某条数据
- Q
- 想通过程序实现数据库备份、恢复
- 如何把两个varchar2得变量,合为一个varchar2得变量,其中一个包含数字和单引号
- 怎么样用exp备份数据时形成的文件名是动态的?例如我每天用exp自动备份一次,使其文件名每天不同,比如加上当天的日期等
- oracle spool命令输出EXCEL列对齐
- oracle 中 用什么 替换 mysql中 regexp 表达式
- 【100分】同一行显示 主表主键和子表主键(子表主键有多个)
- oracle impdp问题!
是oracle里吗?是的话就是用户自定义过程
第一次调用的时候,传入v_tempvar=1
传出v_tempvar=7
第二次调用,传入v_tempvar=2
出现异常,跳转到异常处理部分
为什么会得到这个值,就要看那个过程是怎么定义的了