日期:2014-05-17 浏览次数:21201 次
DECLARE
p_max_size NUMBER := dbms_lob.lobmaxsize;
src_offset NUMBER := 1;
dst_offset NUMBER := 1;
lang_ctx NUMBER := nls_charset_id('UTF8');
default_csid CONSTANT INTEGER := nls_charset_id('ZHS16GBK');
warning NUMBER;
l_file_number PLS_INTEGER := 0;
l_count NUMBER;
l_bfile BFILE;
l_clob CLOB;
l_commitelement xmldom.domelement;
l_parser dbms_xmlparser.parser;
l_doc dbms_xmldom.domdocument;
l_nl dbms_xmldom.domnodelist;
l_n dbms_xmldom.domnode;
rootnode dbms_xmldom.domnode;
parent_rootnode dbms_xmldom.domnode;
file_length NUMBER;
block_size BINARY_INTEGER;
l_rootnode_name VARCHAR2(200);
l_status VARCHAR2(1000);
l_recerrcode VARCHAR2(1000);
l_FailCount VARCHAR2(200);
l_RecCount VARCHAR2(200);
l_name VARCHAR2(1000);
l_comments VARCHAR2(2000);
l_exists BOOLEAN;
FUNCTION convertclobtoxmlelement(p_document IN CLOB)
RETURN xmldom.domelement IS
x_commitelement xmldom.domelement;
l_parser xmlparser.parser;
BEGIN
l_parser := xmlparser.newparser;
xmlparser.parseclob(l_parser, p_document);
x_commitelement := xmldom.getdocumentelement(xmlparser.getdocument(l_parser));
RETURN x_commitelement;
END convertclobtoxmlelement;
BEGIN
-- 检查XML是否在路径FTP_XXX下是否存在
utl_file.fgetattr('FTP_XXX',
'simanhe_test.xml',
l_exists,
file_length,
block_size);