How to convert xml text stored in a VARCHAR and select using XQUERY expression
问题 I have xml documents stored as text in a VARCHAR column. I'd like to convert the text to XML documents in order to perform XQUERY selects on the documents. An example document looks like: <a> <b foor="bar"/> <c/> </a> My query looks like: SELECT XMLQUERY('//c' PASSING XMLCAST('<a><b foor="bar"/><c/></a>' AS XML)) FROM SYSIBM.sysdummy1 But instead of returning a element I get the following error message: SQL Error [10507]: The Context item in an axis step must be a node. SQLCODE=-16012,