Oracle Built−in Packages- P39

Oracle Built−in Packages- P39: 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 private program to encapsulate request processing logic lots of stuff of server PROCEDURE process_request request_rec_IN IN request_rectype IS temp_return_code NUMBER BEGIN increment total 1 stop the server this is a MUST have IF stop_req THEN terminate_TF TRUE ELSIF debugon_req THEN debug_TF TRUE ON ELSIF debugoff_req THEN debug_TF FALSE OFF ELSIF status_req THEN pack_send_status status_rec_IN status_rec response_pipe_IN return_code_OUT temp_return_code debug SEND STATUS temp_return_code unrecognized request ELSE debug UNKNOWN REQUEST END IF END process_request Debug procedure Notice that the server procedure makes several calls to a procedure called debug. The debug procedure dumps informational messages into a simple table to allow tracking of server-side events. This procedure usually inserts data to the table only if the server is in debug mode as determined by the debug_TF global variable. This prevents too many debugging rows from being inserted when the server is operating normally. The debug procedure can be forced to write to the table by setting a parameter called force_TF_IN to TRUE. This is used to guarantee that certain debugging information gets into the table regardless of the server s current debug mode. Debugging messages are usually forced in exception handlers as in the server procedure. Here is the source code for debug Filename on companion disk private program to put debug messages into table if boolean is TRUE or if force_IN is TRUE NOTE commits after inserting row PROCEDURE debug message_IN IN VARCHAR2 force_TF_IN IN BOOLEAN FALSE IS DBMS_PIPE Examples 181 Appendix A What s on the Companion Disk BEGIN .

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
2    86    1    26-06-2024
15    88    2    26-06-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.