Oracle存储过程基本异常处理

http://www.psoug.org/reference/exception_handling.html
http://www.psoug.org/library.html


CREATE OR REPLACE PROCEDURE <procedure_name> IS

BEGIN
  NULL;

EXCEPTION
  WHEN <named_exception> THEN
    -- handle identified exception
  WHEN <named_exception> THEN
    -- handle identified exception
  WHEN OTHERS THEN
    -- handle any exceptions not previously handled
END;
/

例如
CREATE OR REPLACE PROCEDURE myproc IS

BEGIN
  NULL;
EXCEPTION
  WHEN NO_DATA_FOUND THEN
    NULL;
  WHEN ZERO_DIVIDE THEN
    NULL;
  WHEN OTHERS THEN
    NULL;
END;
/

你可能感兴趣的:(html,oracle)