【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
- {"error":400,"message":"over quota"}Error
- Exception和Error的理解ExceptionError
- Error message Object BOM does not allow filter on MAST.STLNRErrorObjectFilterAST
- An error occurred while updating the entries. See the inner exception for details.ErrorWhileExceptionAI
- 你知道PHP中Exception, Error Handler的這些細PHPExceptionError
- local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Allowed memory size of 134217728ErrorException
- [GuzzleHttp\Exception\RequestException] cURL error 60: SSL certificate problem: unable to get localHTTPExceptionError
- 【Java面試指北】Exception Error Throwable 你分得清麼?Java面試ExceptionError
- Java中Error和Exception的異同以及執行時異常(Runtime exception)與檢查型異常(checked exception)的區別JavaErrorException
- CF 2010 C2. Message Transmission Error (hard version) (*1700) 字串+雜湊Error字串
- Error building Player: Win32Exception: ApplicationName=‘xxxxxxxxxxxxxxxxxx//sdk\tools\zipalign.exe' ...ErrorUIWin32ExceptionAPP
- Antd的message.error 彈出的視窗不會關閉的問題Error
- Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception:ErrorJavaExceptionAndroidUIAPT
- Oracle exceptionOracleException
- Android Handler機制之Message及Message回收機制Android
- Sqlserver使用遊標迴圈查詢所有sqlserver error日誌帶有Exception的報錯SQLServerErrorException
- 閉包的理解-from my own opinion
- 適配Android P(9.0)的問題 (百度地圖)HttpClient: Catch connection exception, INNER_ERRORAndroid地圖HTTPclientExceptionError
- 異常(Exception)Exception
- Git commit message 規範GitMIT
- 如何修改git commit message?GitMIT
- Sanic Exception – 異常Exception
- java exception and finally returnJavaException
- ch12_exceptionException
- 小白請教一下,連結資料庫做註冊系統時出現了這個throw new Exception(E.Message); bug資料庫Exception
- What’s your own way of spending two-day weekend?
- C++ Simple Message/Logging ClassC++
- PTP ACS9522 Message rate
- Tkinter (12) 訊息部件 Message
- message: "This action is unauthorized."報錯Zed
- Oracle 中的exception——(Raise)OracleExceptionAI
- oracle 使用異常exceptionOracleException
- 【譯】Exception Helper – Rethrown ExceptionsException
- Symfony\Component\Debug\Exception\FatalErrorExceptionExceptionError
- Sanic exception() 方法/函式Exception函式
- Java-Exception與RuntimeExceptionJavaException
- PHP 異常類 ExceptionPHPException
- Handler,Looper,MessageQueue,Message直接聯絡OOP