由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - XML format
相关主题
oracle和XMLA sql question
mysql 问题 (转载)Re: Web Database
请问XML还有前途么?Sybase最新企业级数据库ASE 12(之-)
誰來解釋一下這是什麼原理[转载] Re: Database and XML
为何query这么慢?[转载] Oracle发布最新版Internet数据库
change year format in Access by SQL query (转载)any tool helps import xml data into oracle?
recursive query helpXML and JAVA
recursive sql?SQL2000XML question
相关话题的讨论汇总
话题: xml话题: load话题: messageid话题: message话题: messageno
进入Database版参与讨论
1 (共1页)
d*******n
发帖数: 109
1
我希望XML里面出现这样的格式:

1
XX

2107


但是我按如下方式写Code的时候出现的不对,请问有什么方法达到上面的格式。
select
'1' AS "MessageNo",
'XX' AS "MessageID"
(select a AS 'No'
from b where c = 1 for XML path('Load'),ELEMENTS)
for XML path('Message'),ELEMENTS
XML实在是把我搞糊涂了,
谢谢指教。
d*******n
发帖数: 109
2
I figured it out myself,
the code should be something like this:
select
'1' AS "MessageNo",
'DLA' AS "MessageID" ,
(select a AS 'No'
from b where c = 1 for XML path('Load'),type, ELEMENTS)
for XML path('Message'),type,ELEMENTS
this key thing for me is to add 'type', so force the XML conversion, without
the 'type', some wrong codes will be generated.
Thanks,
1 (共1页)
进入Database版参与讨论
相关主题
SQL2000XML question为何query这么慢?
'Yukon' to Add Run-Time, XML Supportchange year format in Access by SQL query (转载)
Oracle Bolstering XML In Its Databaserecursive query help
do you guys have any idea about MetaData?recursive sql?
oracle和XMLA sql question
mysql 问题 (转载)Re: Web Database
请问XML还有前途么?Sybase最新企业级数据库ASE 12(之-)
誰來解釋一下這是什麼原理[转载] Re: Database and XML
相关话题的讨论汇总
话题: xml话题: load话题: messageid话题: message话题: messageno