oracle dom模式连接,Oracle:如何显示DBMS_XMLDOM.DOMDocument以进行调试?

DBMS_XMLDOM.WRITETOBUFFER Writes the contents of the node to a buffer.

DBMS_XMLDOM.WRITETOCLOB Writes the contents of the node to a CLOB.

DBMS_XMLDOM.WRITETOFILE Writes the contents of the node to a file.

我有PL / SQL代码,它使用DIRECTORY将它连接到文件系统:

dbms_xmldom.writeToFile(dbms_xmldom.newDOMDocument( xmldoc)

,'DATAPUMPDIR/myfile.xml') ;

我使用dbms_xmldom.writetoclob创建了一个函数

create or replace function xml2clob (xmldoc XMLType) return CLOB is

clobdoc CLOB := ' ';

begin

dbms_xmldom.writeToClob(dbms_xmldom.newDOMDocument( xmldoc)

,clobdoc) ;

return clobdoc;

end;

/

查询:

SELECT xml2clob(Sys_Xmlagg(

Xmlelement(Name "dummy"

,dummy

),Xmlformat('dual')))

FROM dual;

输出:

X

您可以尝试使用这样的函数:

create or replace function dom2clob (domdoc DBMS_XMLDOM.DOMDocument) return CLOB is

clobdoc CLOB := ' ';

begin

dbms_xmldom.writeToClob(domdoc,clobdoc) ;

return clobdoc;

end;

/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值