Oracle Built−in Packages- P35

Oracle Built−in Packages- P35: 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 temp_return_code pipename request_pipe timeout timeout_IN IF temp_return_code 0 THEN check if expected protocol temp_protocol IF temp_protocol request_protocol THEN ELSE pipe message has unexpected protocol temp_return_code -1 debug UNKNOWN PROTOCOL temp_protocol END IF END IF return_code_OUT temp_return_code EXCEPTION WHEN OTHERS THEN return_code_OUT SQLCODE debug RECEIVE REQUEST EXCP SQLERRM force_TF_IN TRUE END receive_unpack_request Calls to RECEIVE_MESSAGE will wait for up to the value of the timeout parameter in seconds for the call to complete. Applications accessing database pipes that are usually empty of messages can incur lengthy wait times or timeouts. When using RECEIVE_MESSAGE under these circumstances be careful to specify a timeout that users can tolerate. The RECEIVE_MESSAGE function will implicitly create a public pipe of the given name if one does not already exist. Tips on Using DBMS_PIPE Oracle does not provide detailed documentation of exactly how database pipes work nor much in the way of how best to use them. The programs in DBMS_PIPE are quite low-level utilities. Higher-level programs using DBMS_PIPE typically need to make numerous calls to these programs which must be in the correct order to handle communications. This can lead to complex and difficult code unless a structured modular template-based approach is used. Through research and experience I have adopted a method for building safe reliable and extensible higher-level communications layers on top of DBMS_PIPE. The following items are the main elements of this method Define message types using PL SQL records Encapsulate pack send and receive unpack logic around record types Tips on Using DBMS_PIPE 161 Appendix A What s on the .

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
Đã 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.