Đang chuẩn bị liên kết để tải về tài liệu:
Oracle Built−in Packages- P93

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Oracle Built−in Packages- P93: Ah, for the good old days of Version 1.0 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 3.0, and you went home at night content with a good day's work done. | Appendix A What s on the Companion Disk r2 Raw string to XOR with r1 9.2.3.4.1 Restrictions This program asserts the following purity level with the RESTRICT_REFERENCES pragma PRAGMA RESTRICT_REFERENCES BIT_XOR WNDS RNDS WNPS RNPS 9.2.3.4.2 Example To toggle a bit if it is off turn it on and if it is on turn it off in a bit flag variable using a bitmask use the BIT_XOR function as follows DECLARE fourteenth VARCHAR2 8 fifteenth VARCHAR2 8 twentieth VARCHAR2 8 mask RAW 4 bitfield1 VARCHAR2 8 bitfield2 VARCHAR2 8 BEGIN set the bitfield for the 15th through 18th bitfieldl 0003C000 set the bitfield for the 26st bitfield2 02000000 set the mask for the 14th fourteenth 00002000 set the mask for the 15th fifteenth 00004000 set the mask for the 20th twentieth 00080000 merge the masks for the 14th 15th and 20th mask UTL_RAW.BIT_OR HEXTORAW fourteenth HEXTORAW fifteenth mask UTL_RAW.BIT_OR mask HEXTORAW twentieth check to see IF the bitfields have the 14th or 20th set IF UTL_RAW.BIT_AND mask HEXTORAW bitfield1 00000000 THEN DBMS_OUTPUT.PUT_LINE bitfield1 is not set ELSE DBMS_OUTPUT.PUT_LINE bitfield1 is set END IF IF UTL_RAW.BIT_AND mask HEXTORAW bitfield2 00000000 THEN DBMS_OUTPUT.PUT_LINE bitfield2 is not set ELSE DBMS_OUTPUT.PUT_LINE bitfield2 is set END IF toggle bit 15 in the mask mask UTL_RAW.BIT_XOR mask HEXTORAW fifteenth check to see IF the bitfield1 has the 14th 15th or 20th set IF UTL_RAW.BIT_AND mask HEXTORAW bitfield1 00000000 THEN DBMS_OUTPUT.PUT_LINE bitfield1 is not set ELSE DBMS_OUTPUT.PUT_LINE bitfield1 is set END IF END This is the output from the previous example bitfieldl is set bitfield2 is not set bitfieldl is not set 9.2.3 The UTL_RAW Interface 451 Appendix A What s on the Companion Disk 9.2.3.5 The UTL_RAW.CAST_TO_RAW function The CAST_TO_RAW function converts the VARCHAR2 input string into a raw datatype. The data is not altered only the data type is changed. This is essentially a VARCHAR2_to_RAW function FUNCTION UTL_RAW.CAST_TO_RAW c IN VARCHAR2 .

TÀI LIỆU LIÊN QUAN