Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

XQuery in for-each returns changes in runtime

Marc PérezJul 25 2012
Hi,
I have the following XQuery function:

------------------------------------------------------------------------------------------------------------------------
if ($calloutResponse//Error)
then
<ns0:serviceResponse>
<ns1:code>001</ns1:code>
<ns0:contacts>{$tempVar//ns0:contacts/node()}</ns0:contacts>
</ns0:serviceResponse>
else
<ns0:serviceResponse>
{if ($tempVar//ns1:code/text() = 001)
then(
<ns1:code>001</ns1:code>
else(
<ns1:code>000</ns1:code>
}<ns0:contacts>{$datosContactosOutput//ns0:contactos/node()}
{
for $contact in ($calloutResponse//contact)
return
<ns0:contact>
FILL CONTACT INFO
</ns0:contact>
}
</ns0:contacts>
</ns0:serviceResponse>
------------------------------------------------------------------------------------------------------------------------

The goal is to call an external service for-each user and get it's contact info. If the call results in an error, code 001 is set with the previous obtained data and the loop continues.

The following correct executions should skip the first condition and check if the existing code is 001, keeping it if so.

When executed on the tester, it respects the <code> value from the previous iteration, but in runtime it takes the last execution's value. That means 001 is only set when the last execution results in an error.

$TempVar is the variable being set with the result of this XQuery and is being fed into the XQuery itself.

Can anyone tell me what's going wrong in runtime?

Thank you!

Comments

vermio
Answer

The isssue was solved by Oracle Support

Marked as Answer by vermio · Sep 27 2020
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 22 2012
Added on Jul 25 2012
0 comments
1,223 views