Đang chuẩn bị liên kết để tải về tài liệu:
Oracle Built−in Packages- P7

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Oracle Built−in Packages- P7: Ah, for the good old days of Version 1.0 of PL /SQL! Life was so simple then. No stored procedures or functions and certainly no packages. You had your set of built−in functions, like SUBSTR and TO_DATE. You had the IF statement and various kinds of loops. With these tools at hand, you built your batch−processing scripts for execution in SQL*Plus, and you coded your triggers in SQL*Forms 3.0, and you went home at night content with a good day's work done. | Appendix A What s on the Companion Disk SQLERRM returns the standard Oracle error message NOTE You will not be able to write a statement like WHEN DBMS_DEFER.UPDATECONFLICT in the Oracle Developer 2000 Release 1 environment. See Section 1.3.6 Calling Built-in Packaged Code from Oracle Developer 2000 Release 1 for more information on this restriction. 1.3.4.2 Package-defined exception In this scenario the package declares one or more exceptions by name only these exceptions do not have message text or a unique number associated with them. When this exception has been raised SQLCODE will always return 1 and SQLERRM will always return the Unhandled user-defined exception message. As a consequence you have two basic options for handling these exceptions You handle by name write an exception handler that references the packaged exception by name. You rely on the WHEN OTHERS clause in which case there is no way for you to know precisely which exception was raised. Let s look at the UTL_FILE package for an example. The following exceptions are defined in the package specification PACKAGE UTL_FILE IS invalid_path EXCEPTION invalid_mode EXCEPTION invalid_filehandle EXCEPTION invalid_operation EXCEPTION read_error EXCEPTION write_error EXCEPTION internal_error EXCEPTION END The UTL_FILE.FOPEN function can raise the INVALID_MODE INVALID_OPERATION or INVALID_PATH exceptions. I can write an exception section for a program using UTL_FILE.FOPEN in one of two ways PROCEDURE my_program IS fid UTL_FILE.FILE_TYPE BEGIN fid UTL_FILE.FOPEN tmp myfile.txt R EXCEPTION WHEN UTL_FILE.INVALID_OPERATION THEN WHEN UTL_FILE.INVALID_MODE THEN WHEN UTL_FILE.INVALID_PATH THEN END or PROCEDURE my_program 1.3.4 Exception Handling and Built-in Packages 21 Appendix A What s on the Companion Disk IS fid UTL_FILE.FILE_TYPE BEGIN fid UTL_FILE.FOPEN tmp myfile.txt R . EXCEPTION WHEN OTHERS Not recommended Information is lost. THEN . END When working with this kind of exception always use the first .

TÀI LIỆU LIÊN QUAN
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.