Home > database >  DB2 clob fields stored XML file query problem
DB2 clob fields stored XML file query problem

Time:09-25

SQL: select num from pr. Paper_info where xmlexists (' $c/entireinfo/baseinfo="test"] '[typeflag passing the content as "c")

Table paper_info field content (clob) store XML file contents, in the content & lt; Entireinfo> Test Node element & lt; Typeflag>="test" record do screening; Execute the query always quote
"SQL16011N XQuery path expression in the intermediate steps of the expression results include atomic values, error
QName=err: XPTY0019 SQLSTATE=10507, "

True don't know is what reason, please!!!!!!

CodePudding user response:

Select XMLCAST (xmlquery (' $d/sections/section [1]/content 'PASSING XMLPARSE (DOCUMENT (REPORT_TEXT_INFO)) AS "d") AS a VARCHAR (2000)) from REPORT_DOC_TBL, so that you can, use the DOCUMENT first to turn a little, and then using XMLPARSE into XML,

CodePudding user response:

Clob that cannot be directly as XML, database will not automatically conversion type, to transfer to a little with the DOCUMENT first, then using XMLPARSE into XML, before they can,

For example: select XMLCAST (xmlquery (' $d/sections/section [1]/content 'PASSING XMLPARSE (DOCUMENT (REPORT_TEXT_INFO)) AS "d") AS a VARCHAR (2000)) from REPORT_DOC_TBL, thus,

  •  Tags:  
  • DB2
  • Related