sqlplus 报告 - XML 数据被截断
我正在运行一个查询,该查询将 XML 数据和假脱机返回到文件。我遇到查询输出被截断的问题。它看起来像这样:
XMLDATA
----------------------------------------
<?xml version="1.0" standalone="yes"?>
<msgs>
<msg>
<PNUM>ABC12345
我期望的是这样的:
XMLDATA
----------------------------------------
<?xml version="1.0" standalone="yes"?>
<msgs>
<msg>
<PNUM>ABC1234567</PNUM>
<MSG_ID>1234</MSG_ID>
<NAME>Test message</NAME>
<TEXT>This is the main content of the message</TEXT>
</msg>
<!-- about 60 other msg elements -->
</msgs>
select
语句足够简单:
select xmlroot(xmlelement("msgs",xmlagg(xmlelement("msg",xmlforest(PNUM , MSG_ID , NAME, TEXT)))), VERSION '1.0', STANDALONE YES) xmldata
from ...
我猜这里有一些 sqlplus 格式化技巧,我只是不知道是哪一个(甚至不知道是哪一个)它叫什么)。
(Oracle版本为10g)
I am running a query that returns XML data and spools to a file. I'm having a problem where the output of the query is being truncated. Here's what it looks like:
XMLDATA
----------------------------------------
<?xml version="1.0" standalone="yes"?>
<msgs>
<msg>
<PNUM>ABC12345
What I am expection was something like this:
XMLDATA
----------------------------------------
<?xml version="1.0" standalone="yes"?>
<msgs>
<msg>
<PNUM>ABC1234567</PNUM>
<MSG_ID>1234</MSG_ID>
<NAME>Test message</NAME>
<TEXT>This is the main content of the message</TEXT>
</msg>
<!-- about 60 other msg elements -->
</msgs>
The select
statement is simple enough:
select xmlroot(xmlelement("msgs",xmlagg(xmlelement("msg",xmlforest(PNUM , MSG_ID , NAME, TEXT)))), VERSION '1.0', STANDALONE YES) xmldata
from ...
I am guessing there's some sqlplus formatting trick here, I just don't know which one (or even what it's called).
(Oracle version is 10g)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能会有所帮助:
This might help: