I am new to the CLPPlus editor and I'm trying a simple query that works if I execute it from a file like this
db2 -td% -svf C:\query.sql
and the query.sql file contains:
SELECT tx.ID,XMLQUERY('for $e in $d/Client/Address return data($e)' passing tx.contactinfo as "d") FROM clients tx %
If I just place the query as it is in the CLP or CLPPLUS editor as it is I get errors.
Error FROM CLP: SQL0104N An unexpected token "for $e in $d/Client/Ad" was found following "LECT tx.ID,XMLQUERY(". Expected tokens may include: "
Error from CLPPLUS: SQL16002N An XQuery expression has an unexpected token "in" following "for ". Expected tokens may include: "is". Error QName=err:XPST0003.