tailieunhanh - Building Oracle XML Applications phần 7

bạn sẽ thấy nội dung của bộ đệm trang trong SQL * Plus giao diện điều khiển lệnh. Sau khi yêu cầu các bộ đệm trang, các thói quen OWA tuôn ra bộ đệm. Cơ sở dữ liệu định dạng dữ liệu trong XML Sử dụng PL / SQL Quá trình tạo ra năng động, tài liệu XML trong | emps emp list -- Holds a list of Employees emp emp t -- Holds a single Employee BEGIN -- Insert the master INSERT INTO dept deptno dname VALUES -- Insert the details using value of as the DEPTNO emps FOR i IN LOOP emp emps i INSERT INTO emp deptno empno ename sal VALUES END LOOP END This trigger inserts the and values into the dept table then loops over the collection of Employees being inserted and inserts the values of each one as a new row in the emp table using the value of as the DEPTNO foreign key value in the emp table. With the department view in place and the DepartmentList datagram transformed into canonical format in the file we can insert the transformed document using OracleXML like this java OracleXML putXML -user xmlbook xmlbook -fileName department This successfully inserts two rows into the department object view with each row inserted in the object view translating into one row in the dept table and one or more rows added to the emp table. Inserting Datagrams with Document Fragments The product-list datagram in Example contains the nested structure for weight image and dimensions as well as an embedded document fragment of well-formed HTML in its features element. Example . Product List Datagram with Nested Structure product-list product sku 1234567 sku class CD Player class manufacturer Sony manufacturer model D-F411 model weight units g units amount 260 amount weight image small small large large image dimensions units mm units width 133 width length 152 length height 33 height dimensions price price features ul li b SteadySound b The Next Generation Of Skip Protection surpasses Sony s current 20-second Buffer Memory system. li li b Synthesized Digital AM FM Stereo Tuner b precisely locks in the most powerful signal .