2017-02-13 51 views
-1
SELECT sysxml.XPathValue(O.CAST(xmlOrder VARCHAR(1000) CHARACTER SET UNICODE), '//ORDER/PO_NUMBER/*') AS PO_Number, 
     sysxml.XPathValue(O.CAST(xmlOrder VARCHAR(1000) CHARACTER SET UNICODE), '//ORDER/DATE/*') AS theDate 
FROM COMMON.OrderLog O 
WHERE sysxml.XPathValue(O.CAST(xmlOrder VARCHAR(1000) CHARACTER SET UNICODE), '//ORDER/BILLTO/*') = 'Mike'; 
+0

http://www.wikihow.com/Ask-a-Question-on-Stack -Overflow –

回答

1

CAST不是OxmlOrder的一部分。
因此,而不是這樣的:

O.CAST(xmlOrder ... 

你可能需要做這在所有三行:

CAST(O.xmlOrder ... 
+0

'AS'也缺失:'(CAST(O.xmlOrder VARCHAR(1000)AS CHARACTER SET UNICODE)' – dnoeth

+0

SELECT XPathValue(CAST(o.xmlOrder as VARCHAR(1000)CHARACTER SET UNICODE),' // ORDER/PO_NUMBER/*')AS PO_Number, XPathValue(CAST(o.xmlOrder as VARCHAR(1000)CHARACTER SET UNICODE),'// ORDER/DATE/*')as the Date FROM COMMON.OrderLog O WHERE XPathValue(CAST(o.xmlOrder as VARCHAR(1000)CHARACTER SET UNICODE),'// ORDER/BILLTO/*')='Mike'; – Altaaf

+0

更正了上面的查詢,但仍然收到相同的錯誤。 – Altaaf

相關問題