oracle练习02

简介: oracle练习02
declare
a int:= 18;
b int:=0;
begin
if b<>0 then
dbms_output.put_line('商为:'||a/b);
else
raise_application_error(-20008,'不正常!');
end if;
exception
when others then
dbms_output.put_line(sqlcode||','||sqlerrm);
end;
SQL> declare
  2  a int:= 18;
  3  b int:=0;
  4  begin
  5  if b<>0 then
  6  dbms_output.put_line('商为:'||a/b);
  7  else
  8  raise_application_error(-20008,'不正常!');
  9  end if;
 10  exception
 11  when others then
 12  dbms_output.put_line(sqlcode||','||sqlerrm);
 13  end;
 14  /
-20008,ORA-20008: 不正常!
PL/SQL 过程已成功完成。
SQL>
相关文章
|
2月前
|
存储 Oracle 关系型数据库
Oracle
【7月更文挑战第21天】Oracle
62 1
|
4月前
|
Oracle 关系型数据库
oracle fgac
oracle fgac
27 4
|
4月前
|
Oracle 关系型数据库
Oracle使用遇到的问题
Oracle使用遇到的问题
|
消息中间件 NoSQL Oracle
Oracle 惨不忍睹!
Oracle 惨不忍睹!
|
SQL Oracle 关系型数据库
Oracle根据时间查询
Oracle根据时间查询
Oracle根据时间查询
|
Oracle 关系型数据库 Java
Oracle的坑
Connection Reset ORA-00942
1507 0
|
SQL 关系型数据库 Perl
|
Oracle 关系型数据库 数据库
|
Oracle 关系型数据库 数据库