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

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

Oracle Built−in Packages- P72: 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 fileID UTL_FILE.FILE_TYPE strbuffer VARCHAR2 100 mynum NUMBER BEGIN fileID UTL_FILE.FOPEN tmp numlist.txt R UTL_FILE.GET_LINE fileID strbuffer mynum TO_NUMBER strbuffer END When GET_LINE attempts to read past the end of the file the NO_DATA_FOUND exception is raised. This is the same exception that is raised when you a execute an implicit SELECT INTO cursor that returns no rows or b reference an undefined row of a PL SQL nested in PL SQL8 table. If you are performing more than one of these operations in the same PL SQL block remember that this same exception can be caused by very different parts of your program. 6.2.4 Writing to Files In contrast to the simplicity of reading from a file UTL_FILE offers a number of different procedures you can use to write to a file UTLFILE.PUT Puts a piece of data string number or date into a file in the current line. UTLFILE.NEWLINE Puts a newline or line termination character into the file at the current position. UTLFILE.PUTLINE Puts a string into a file followed by a platform-specific line termination character. UTLFILE.PUTF Puts up to five strings out to the file in a format based on a template string similar to the printf function in C. You can use these procedures only if you have opened your file with modes W or A if you opened the file for read-only the runtime engine will raise the UTL_FILE.INVALID_OPERATION exception. Starting with Oracle 8.0.3 the maximum size of a file string is 32K the limit for earlier versions is 1023 bytes. If you have longer strings you must break them up into individual lines perhaps using a special continuation character to notify a post-processor to recombine those lines. 6.2.4.1 The UTL_FILE.PUT procedure The PUT procedure puts data out to the specified open file. Here s the header for this procedure PROCEDURE UTL_FILE.PUT file IN UTL_FILE.FILE_TYPE buffer OUT VARCHAR2 Parameters are summarized in the following table. Parameter Description file The file

TÀI LIỆU LIÊN QUAN