0

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.

Garry
  • 4,996
  • 5
  • 32
  • 44
ChrisNic
  • 11
  • 3
  • You may want to include a screenshot of how you "place the query in the editor". If you run that simply from the command line, you'll need to properly escape all quotes and other special characters. – mustaccio May 27 '15 at 20:09
  • Thanks for that input. I escaped the double quotes on the CLP and it works but when I ran the same query in the CLPPLUS it still did not work. – ChrisNic May 28 '15 at 13:58

0 Answers0