从文本列检索xml数据 [英] Retrieve xml-data from text-column
问题描述
我有一个表包含一个包含xml文件的字段(数据类型文本)。在一些尝试和错误后,我发现从表中提取完整的xml文件的唯一方法是使用ms sql的FOR XML子句。
但是我的下一个问题是,包含xml文件的colum被命名为类似于XML_F52E2B61-18A1-11D1-B105-00805F49916B,这是cf的一个无效的标识符。
I've a table which has a field (datatype "text") that contains a xml-file. After some try and error I found out that the only way to fetch the complete xml-file from that table is to use the "FOR XML" clause of ms sql. But my next problem is, that the colum containing the xml-file is named something like "XML_F52E2B61-18A1-11D1-B105-00805F49916B" which is an invald identifier for cf.
是否有通过其id而不是其名称访问该列的方法?或者访问此列的最佳方法是什么?
Is there a way to access that column by its id instead of its name or what's the best way to access this column?
编辑:
我使用的SQL语句是:
The SQL statement I'm using is:
SELECT XmlPackage
FROM LogK3OnChange
WHERE DealerID = IsNull(<cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.dealerid#">, DealerID)
AND LogID = <cfqueryparam cfsqltype="cf_sql_varchar" value="#arguments.logid#">
FOR XML RAW
请注意,
Heiko
推荐答案
了解更多
<cfoutput>#myQuery["XML_F52E2B61-18A1-11D1-B105-00805F49916B"][1]#</cfoutput>
操作
这篇关于从文本列检索xml数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!