View previous topic :: View next topic
|
Author |
Message |
Kadhir A
New User
Joined: 25 Jun 2020 Posts: 3 Location: United Kingdom
|
|
|
|
Hi, I get a SQLCODE = -16002 error for the below query
Code: |
---------+---------+---------+---------+---------+---------+---------+---------+
SELECT XMLQUERY(
'//Element1'
PASSING XML_Column)
FROM Qualifier.XML_table
WHERE XMLEXISTS ('//Element1[@Attribute1="value1"]'
passing XML_Column )
and XML_TYP = 'O'
and TRN_TS between '2021-05-26-09.01.01.000001'
and '2021-05-26-10.01.01.000001'
with ur ;
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -16002, ERROR: AN XQUERY EXPRESSION HAS AN UNEXPECTED
TOKEN [ FOLLOWING Element1. EXPECTED TOKENS MAY INCLUDE: ( $ /
// castable union ] * div idiv mod to + - eq ne. ERROR QNAME=err:XPST-
0003
DSNT418I SQLSTATE = 10505 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNXQPRS SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = -300 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'FFFFFED4' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION
---------+---------+---------+---------+---------+---------+---------+---------+ |
I do not see anything wrong with the syntax unless I am overlooking something. An example is given in
https://www.ibm.com/docs/en/db2-for-zos/12?topic=predicates-xmlexists-predicate
I did a search in the forum and hit at https://ibmmainframes.com/about40332.html
but the replies did not help.
I would appreciate your observations on this. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Square brackets are NOT standard EBCDIC characters and hence their implementation can vary depending upon the code page. The collating sequence X'BA' and X'BB' can be the square brackets but IBM's C compilers recognize X'AD' and X'BD' as the square brackets. It is possible that your DB2 is looking for the wrong characters to be the square brackets. |
|
Back to top |
|
|
|