Hello,
I am trying to do updates within the if-then-else statement. I’ve got a xquery parsing error.
for $q in input()/user
where $q/lastname = 'xxx' and $q/firstname = 'yyy'
return if (count($q)>0)
then(update replace $q/phonenumber with 'zzz')
else(update insert <user><lastname>xxx</lastname><firstname>yyy</firstname><phonenumber>zzz<phonenumber></user>)
I assume that update is not supported in if-then-else statement.
My scenario is that: if the user exists, I just change the phonenumber, if not, I have to insert the user completely.
I am searching for a way to solve this problem with one xquery instead of two.
Any suggestion is welcome.
mzha
#API-Management#Tamino#webMethods