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

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Oracle Built−in Packages- P84: 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 Parameters are summarized in the following table. Parameter Purpose file_loc File locator for the file to be opened open_mode Indicates that file access will be read-only this parameter can be omitted from calls to FILEOPEN because the program assigns a default value of FILE_READONLY 8.3.1.3.1 Exceptions The following types of exceptions can be raised by the FILEOPEN procedure NOEXIST_DIRECTORY The directory alias associated with file_loc does not exist. OPENTOOMANY The number of open files exceeds the SESSION_MAX_OPEN_FILES limit. INVALIDARGVAL The open_mode value is not FILE_READONLY. INVALID_OPERATION The file does not exist or the user does not have privileges to access the file. VALUE_ERROR The file_loc parameter contains an improper value e.g. NULL . 8.3.1.3.2 Examples This example uses the FILEOPEN procedure to check whether chapter01.txt exists in the BOOK_TEXT directory then opens and closes the file DECLARE book_file_loc BFILE NULL book_file_exists BOOLEAN FALSE 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 chapter01.txt exists DBMS_OUTPUT.PUT_LINE opening the file DBMS_LOB.FILEOPEN book_file_loc DBMS_OUTPUT.PUT_LINE closing the file DBMS_LOB.FILECLOSE book_file_loc END IF END This is the output of the script chapter01.txt exists opening the file closing the file 8.3.1 Working with BFILEs 406 Appendix A What s on the Companion Disk The FILEOPEN procedure raises a VALUE_ERROR exception when passed to a NULL file. The procedure raises a NOEXIST_DIRECTORY exception when passed to a file locator associated with a nonexistent directory alias. Note that it is possible to open the same file using two different file locators for example DECLARE book_file_loc_1 book_file_loc_2 book file exists BFILE NULL BFILE NULL BOOLEAN FALSE BEGIN book_file_loc_1 BFILENAME BOOK_TEXT chapter01.txt book_file_loc_2 BFILENAME BOOK_TEXT

TÀI LIỆU LIÊN QUAN