Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQLCODE = -16002 when using XMLEXISTS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Kevin Ho

New User


Joined: 05 May 2009
Posts: 1
Location: San Francisco

PostPosted: Tue May 05, 2009 10:42 pm    Post subject: SQLCODE = -16002 when using XMLEXISTS
Reply with quote

Hi All,

I am trying to execute the following query and it return with -16002 SQLCODE regading there should not be a ']' after the compare argument. I have look up the syntax of XMLEXISTS in some of the website and all o them seem to use ] with no problem. Maybe there is something else I am missing when coding the query??

Code:
SELECT * FROM EMPLOYEE                                                 
    WHERE XMLEXISTS('$D/RESUME/PERSON[NAME = "KEVIN HO"]'             
    PASSING EMPLOYEE.EMP_CV AS "D")                                     ---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -16002, ERROR:  AN XQUERY EXPRESSION HAS AN UNEXPECTED       
         TOKEN ] FOLLOWING "KEVIN HO". EXPECTED TOKENS MAY INCLUDE: Ý / //     
         union | * div idiv mod to + - eq ne lt le gt ge = != < <=. ERROR       
         QNAME=err:XPST0003                                                     
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
Back to top
View user's profile Send private message

sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed May 06, 2009 3:17 pm    Post subject:
Reply with quote

Hi Kevin,

Welcome to the FORUMS!

I tried something like this, it worked.
Code:
select * from countries where
xmlexists('$EXTNAME/country/country_name/short[fn:starts-with(.,"Germany")]')


Try something like this, might work:
Code:
select * from employee
where xmlexists('$D/RESUME/PERSON[fn:starts-with(.,"KEVIN HO"]')


I found a link of IBM very interesting one for trying out XML queries, this might help you.
Xquery

For other databases including DB2 you can use this
SQLzoo

Thank You,
Sushanth
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am
No new posts SQLCODE-000000080N priya91 DB2 1 Mon Feb 01, 2016 4:35 pm
No new posts Need to understand SQLCODE = 12 rohanthengal DB2 3 Thu Nov 05, 2015 11:22 am
No new posts SQLCODE -922 in Batch-Cics program tr... kishpra CICS 2 Thu Sep 10, 2015 12:36 pm
No new posts SQLCODE -450 for stored procedure spoorni DB2 3 Fri Jan 16, 2015 2:45 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us