【Exception】:own error message
CREATE OR REPLACE PROCEDURE p_test_raise_salary(emp_id NUMBER,
amount NUMBER) AS
curr_sal varchar2(30);
BEGIN
SELECT dual.dummy INTO curr_sal FROM dual;
IF curr_sal IS not NULL THEN
/* Issue user-defined error message. */
raise_application_error(-20101, 'Salary is missing');
ELSE
dbms_output.put_line('test');
END IF;
END p_test_raise_salary;
for pro c:
EXEC SQL EXECUTE
/* Execute embedded PL/SQL block using host
variables my_emp_id and my_amount, which were
assigned values in the host environment. */
DECLARE
null_salary EXCEPTION;
/* Map error number returned by raise_application_error
to user-defined exception. */
PRAGMA EXCEPTION_INIT(null_salary, -20101);
BEGIN
raise_salary(:my_emp_id, :my_amount);
EXCEPTION
WHEN null_salary THEN
INSERT INTO emp_audit VALUES (:my_emp_id, ...);
END;
END-EXEC;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16179598/viewspace-584816/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Exception和ErrorExceptionError
- Exception和Error的理解ExceptionError
- Oracle XA Exception error codeOracleExceptionError
- Error message: ORA-48913Error
- Exception String: Error in invoking target of makefileExceptionError
- php的Error與Exception捕獲問題PHPErrorException
- /var/log/message 錯誤error (network unreachable)Error
- Exception String: Error in invoking target install of makefileExceptionError
- Error message Object BOM does not allow filter on MAST.STLNRErrorObjectFilterAST
- An Introduction to Error Message Articles [ID 22080.1]Error
- error: const std::string message = "Hello" + ", world" + exclam;Error
- 你知道PHP中Exception, Error Handler的這些細PHPExceptionError
- 【Java面試指北】Exception Error Throwable 你分得清麼?Java面試ExceptionError
- Java的Exception和Error面試題10問10答JavaExceptionError面試題
- SAP note 532914:Derivation of chars: No error message, although flag is setError
- [GuzzleHttp\Exception\RequestException] cURL error 60: SSL certificate problem: unable to get localHTTPExceptionError
- Java中Error和Exception的異同以及執行時異常(Runtime exception)與檢查型異常(checked exception)的區別JavaErrorException
- An error occurred while updating the entries. See the inner exception for details.ErrorWhileExceptionAI
- She Got her ownGo
- MySQL 5.7.17 安裝報錯CMake Error at cmake/boost.cmake:81 (MESSAGE)MySqlError
- local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Allowed memory size of 134217728ErrorException
- error C2713: Only one form of exception handling permitted per functionErrorORMExceptionMITFunction
- 網站部署後Parser Error Message: Could not load type 的解決方案網站Error
- "Failed to create empty document" error message appears when opening the BrightStor ARCserve BackupAIErrorAPP
- Build Your Own Cas Service - ProUI
- ExceptionException
- 為何在JBoss中釋出Message-Driven Bean總出Exception in thread "main" javax.naming.NamBeanExceptionthreadAIJava
- Message(Message Pool)原始碼分析原始碼
- CMake Error at cmake/readline.cmake:85 (MESSAGE): Curses library not found.Error
- Getting "JVM_GetClassSignature" error message during upgrade of GC_888769.1JVMErrorGC
- ORA-27300: ORA-27301: OS failure message: Error 0 錯誤AIError
- Oracle exceptionOracleException
- Java——ExceptionJavaException
- adstrtal.sh報超時錯誤 ERROR : Timed out( 100000 ): Interrupted ExceptionErrorException
- 閉包的理解-from my own opinion
- Sqlserver使用遊標迴圈查詢所有sqlserver error日誌帶有Exception的報錯SQLServerErrorException
- 異常(Exception)Exception
- 2.4.ExceptionException