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

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

Oracle Built−in Packages- P86: 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 NULL Either amount offset_1oroffset_2 is less than 1 or amount offset_1 or offset_2is greater thanLOBMAXSIZE. 8.3.2.1.1 Exceptions The COMPARE function may raise the following exceptions NOEXISTDIRECTORY For BFILEs. UNOPENEDFILE For BFILEs. Files must be open before comparison. NOPRIVDIRECTORY For BFILEs. INVALIDDIRECTORY For BFILEs. INVALIDOPERATION For BFILEs. 8.3.2.1.2 Restrictions The program asserts a purity level with the RESTRICT_REFERENCES pragma. PRAGMA RESTRICT_REFERENCES compare WNDS RNDS WNPS RNPS 8.3.2.1.3 Examples The following example compares two BFILE locators that are pointing to the same file. Note that for BFILEs we must provide a number of bytes in the amount parameter to compare which is determined via the GETLENGTH function. Note also that for BFILES we must first open the files. DECLARE v_file_loc_1 BFILE v_file_1_length INTEGER v_file_loc_2 BFILE BEGIN v_file_loc_1 BFILENAME IMAGES ourlogo.bmp v_file_loc_2 BFILENAME IMAGES ourlogo.bmp DBMS_LOB.FILEOPEN v_file_loc_1 DBMS_LOB.FILEOPEN v_file_loc_2 v_file_1_length DBMS_LOB.GETLENGTH v_file_loc_1 IF DBMS_LOB.COMPARE v_file_loc_1 v_file_loc_2 v_file_1_length 0 THEN DBMS_OUTPUT.PUT_LINE file_loc_1 equals file_loc_2 ELSE DBMS_OUTPUT.PUT_LINE file_loc_1 is not equal to file_loc_2 END IF DBMS_LOB.FILECLOSEALL END 8.3.2 Reading and Examining LOBs 416 Appendix A What s on the Companion Disk This is the output of the script file_loc_1 equals file_loc_2 This example compares two diagrams from the my_book_diagrams table DECLARE CURSOR diagram_cur num IN INTEGER IS SELECT diagram FROM my_book_diagrams WHERE chapter_descr Chapter 1 AND diagram_no num v_diagram_1_loc BLOB v_diagram_2_loc BLOB BEGIN OPEN diagram_cur 1 FETCH diagram_cur INTO v_diagram_1_loc CLOSE diagram_cur OPEN diagram_cur 2 FETCH diagram_cur INTO v_diagram_1_loc CLOSE diagram_cur IF DBMS_LOB.COMPARE v_diagram_1_loc v_diagram_2_loc 0 THEN DBMS_OUTPUT.PUT_LINE diagrams are equal ELSE .

TÀI LIỆU LIÊN QUAN