tailieunhanh - Oracle Built−in Packages- P89
Oracle Built−in Packages- P89: Ah, for the good old days of Version 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 , and you went home at night content with a good day's work done. | Appendix A What s on the Companion Disk Suddenly a scream rang out. An EXCEPTION had not been handled. The procedure The WRITE procedure writes a given number of bytes BLOB or characters CLOB NCLOB to an internal LOB beginning at a specified offset. The contents of the write operation are taken from the buffer. WRITE replaces overlays any data that exists in the LOB at the offset. The headers for this program for each corresponding LOB type are the following PROCEDURE lob_loc IN OUT BLOB amount IN BINARY_INTEGER offset IN INTEGER buffer IN RAW PROCEDURE lob_loc IN OUT CLOB CHARACTER SET ANY_CS amount IN BINARY_INTEGER offset IN INTEGER buffer IN VARCHAR2 CHARACTER SET lob_loc CHARSET The overloaded specification allows WRITE to be used with BLOBs CLOBs and NCLOBs. The term ANY_CS in the specification allows either CLOB or NCLOB locators as input. WRITE cannot be used with BFILEs because access to BFILEs is read-only. Parameters are summarized in the following table. Parameter Description lob_loc A locator for the target LOB amount Number of bytes BLOB or characters CLOB NCLOB to be written offset The location of the byte BLOB or character CLOB NCLOB in the LOB at which the write begins buffer Buffer holding the contents of the write operation Exceptions The WRITE procedure may raise any of the following exceptions VALUEERROR lob_loc amount or offset is NULL or invalid. INVALIDARGVAL One of the following conditions exists amount 1 or amount 32767 offset 1 or offset LOBMAXSIZE Example In the following example we write the string The End to the end of the Chapter 2 chapter_textcolumn in the my_book_text table. We display the new text roll back the changes and display the original text. Internal LOBs can participate in database transactions. Updating BLOBs CLOBs and NCLOBs 431 Appendix A What s on the Companion Disk SET LONG 200 COL chapter_descr FOR A15 COL chapter_text FOR A40 .
đang nạp các trang xem trước