Hello, I am new to to DB2 and am stuck on a simple query. I have a table that contains some columns, one of which is an XML datatype.
I am using DB2-express c v9.7
When doing the below simple xquery through the control center
xquery
transform
copy $mycust := db2-fn:sqlquery('select XmlFile from table')
modify
do replace $mycust//DataNode/text()
with "newText"
return $mycust
it does in fact return properly. But when I try to incorporate it into a sql update statement such as
update table
SET XmlFile = xquery (
transform
copy $mycust := $c
modify do replace $mycust//DataNode/text()
with "newText"
return $mycust
passing XmlFile as "c"
)
I get an error message stating:
SQL0104N An unexpected token "copy $mycust := $c modify do replace $myc" was found following "= xquery ( transform". Expected tokens may include: "<space>".
I have gone back and forth, verifying syntax, typos, and still have not been able to locate the problem. Can someone help?
Thanks