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

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

Oracle Built−in Packages- P85: 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 WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE OTHERS Exception sqlerrm END This is the output of the script closing non_existent_file.txt in NON_EXISTENT_DIRECTORY FILECLOSE raises a VALUE_ERROR exception when passed a NULL file locator. See the FILEOPEN and FILECLOSEALL sections for other examples of FILECLOSE usage. 8.3.1.6 The DBMS_LOB.FILECLOSEALL procedure The FILECLOSEALL procedure is used to close all BFILEs that are open within a session. Here s the header for this program PROCEDURE DBMS_LOB.FILECLOSEALL 8.3.1.6.1 Exceptions The FILECLOSEALL procedure raises an UNOPENED_FILE exception if no files are open. 8.3.1.6.2 Examples When an exception occurs after opening a file it is possible that execution continues without closing the file i.e. a matching call to FILECLOSE is not executed due to abnormal termination of a block . In this case the file remains open and we run the risk of exceeding the SESSION_MAX_OPEN_FILES limit. It is good practice to include a call to FILECLOSEALL within an exception handler whenever FILEOPEN is used. The following anonymous block shows how you might construct an exception section that will close any open files DECLARE book_file_loc BFILE NULL book_file_exists BOOLEAN FALSE x NUMBER BEGIN book_file_loc BFILENAME BOOK_TEXT chapter01.txt book_file_exists DBMS_LOB.FILEEXISTS book_file_loc 1 IF book_file_exists THEN DBMS_OUTPUT.PUT_LINE opening chapter01.txt DBMS_LOB.FILEOPEN book_file_loc Intentionally raise a ZERO_DIVIDE exception x 1 0 DBMS_LOB.FILECLOSE book_file_loc END IF EXCEPTION WHEN OTHERS THEN BEGIN DBMS_OUTPUT.PUT_LINE Clean up using FILECLOSEALL DBMS_LOB.FILECLOSEALL EXCEPTION WHEN DBMS_LOB.UNOPENED_FILE THEN DBMS_OUTPUT.PUT_LINE No files to close raising the UNOPENED_FILE exception. 8.3.1 Working with BFILEs 411 Appendix A What s on the Companion Disk WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE OTHERS Exception sqlerrm END END This is the output of the script opening chapter01.txt Clean up .

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.