Oracle Built−in Packages- P33

Oracle Built−in Packages- P33: 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 Restrictions Note that the user session s local message buffer is limited to 4096 bytes. Example In this example a hex string is converted to RAW packed into the session buffer using the PACK_MESSAGE_RAW procedure and sent to a pipe. Filename on companion disk DECLARE hex_data VARCHAR2 12 FFEEDDCCBBAA raw_data RAW 6 call_status INTEGER BEGIN create some raw data raw_data HEXTORAW hex_data pack and send raw data on pipe raw_data call_status OPBIP_TEST_PIPE IF call_status 0 THEN Send message failed END IF END Applications that need to send large or sensitive data items through database pipes may benefit from using compression and or encryption on the data and packing the results using PACK_MESSAGE_RAW. The procedure The PACK_MESSAGE_ROWID procedure packs an item of datatype ROWID into the user session s local message buffer. The header for this program follows PROCEDURE item IN ROWID The item parameter is the ROWID to pack into the message buffer. Exceptions The program does not raise any package exceptions. The ORA-06558 Oracle exception is raised if the message buffer becomes full and no more items can be packed. Restrictions Note that the user session s local message buffer is limited to 4096 bytes. Example This somewhat contrived example shows a trigger that places the ROWIDs of new or modified rows of the emp table into a database pipe. Filename on companion disk CREATE OR REPLACE TRIGGER emp_AIU Packing and Unpacking Messages 151 Appendix A What s on the Companion Disk AFTER INSERT OR UPDATE ON emp FOR EACH ROW DECLARE rowid_pipename VARCHAR2 20 ROWID_PIPE call_status INTEGER BEGIN pack and send the rowid to a pipe call_status rowid_pipename IF .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
28    125    1    20-05-2024
Đã 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.