tailieunhanh - Oracle Built−in Packages- P94

Oracle Built−in Packages- P94: 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 r_string1 r_string1 END Sample output follows r_string1 Test Test Test Test The function The LENGTH function returns the number of bytes in the raw input string given by the r parameter FUNCTION r IN RAW RETURN NUMBER where r is the raw input string. Restrictions This program asserts the following purity level with the RESTRICT_REFERENCES pragma PRAGMA RESTRICT_REFERENCES LENGTH WNDS RNDS WNPS RNPS Example Here is an example of the LENGTH function r_1 RAW 32000 r_2 RAW 32000 r_3 RAW 32000 BEGIN r_1 hextoraw 00 hextoraw FF r_2 r_1 r_1 r_1 r_1 r_1 r_1 r_1 r_1 r_3 r_2 r_2 r_2 r_2 r_2 r_2 r_2 r_2 DB Length of r_1 r_1 Length of r_2 r_2 Length of r_3 r_3 END Sample output follows Length of r_1 256 Length of r_2 2048 Length of r_3 16384 The function The OVERLAY function overwrites the specified section of the target raw string with the string specified in the overlay_str parameter and returns the overwritten raw string. The overwriting starts pos bytes into the target string and continues for len bytes right-padding the target with the pad parameter as needed to extend the target if necessary. The len parameter must be greater than 0 and pos must be greater than 1. If pos is greater than the length of the target string then the target is right-padded with pad before the overlaying begins. Here s the specification FUNCTION overlay_str IN RAW target IN RAW pos IN BINARY_INTEGER DEFAULT 1 The UTL_RAW Interface 456 Appendix A What s on the Companion Disk len IN BINARY_INTEGER DEFAULT NULL pad IN RAW DEFAULT NULL RETURN RAW The parameters for this program are summarized in the following table. Parameter Description overlay_str The raw string used to overwrite