1
下面是我從拍攝的過程net..but在執行其給我的錯誤是「xmlgen.setRowsetTag必須聲明」讀取XML文件
請告訴我,如果這是錯誤由於一些設置錯誤或者我必須包括一些文件.. 我使用PL/SQL開發人員10g的
Thankss: -
create or replace procedure SP_XML_TEST is
begin
declare
xmlString CLOB := null;
-- Here we are reading 250 bytes at a time. We should be really reading a
-- whole chunk. dbms_output.put_line can only accomodate 256 characters per line
-- so we have this limitation.
amount integer:= 255;
position integer := 1;
charString varchar2(255);
begin
xmlgen.setRowTag('EMP_ROW'); -- we want the row element to be named EMP_ROW.
xmlgen.setRowsetTag('EMP_RESULTS'); -- we want the result document root to be EMP_RESULTS.
xmlgen.setMaxRows(3); -- limit the output to 3 rows.
xmlgen.setskipRows(2); -- skip the first two rows in the query before outputing results.
xmlgen.useLowerCaseTagNames(); -- set the tag names to be all in lower case.
xmlgen.setErrorTag('ERROR_RESULT'); -- set the ERROR tag to be ERROR_RESULTS.
xmlgen.setRowIdAttrName('ENO'); -- set the id attribute in the ROW element to be ENO.
xmlgen.setRowIdColumn('EMPNO'); -- use the EMPNO column's value for the id attribute.
xmlgen.useNullAttributeIndicator(false); -- do not use the null indicator to indicate nullness.
xmlgen.setStyleSheet('http://www.oracle.com/xsl'); -- attach the stylesheet PI to the result document.
xmlString := xmlgen.getXML('select * from scott.emp ',1); -- This gets the XML out
dbms_lob.open(xmlString,DBMS_LOB.LOB_READONLY); -- Now open the lob data..
loop
dbms_lob.read(xmlString,amount,position,charString); -- read the lob data
dbms_output.put_line(charString);
position := position + amount;
end loop;
exception
when no_data_found then
dbms_lob.close(xmlString); -- end of fetch, free the lob
dbms_lob.freetemporary(xmlString);
xmlgen.resetOptions;
when others then
xmlgen.resetOptions;
end;
end SP_XML_TEST;