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!

Exiting a for loop in the middle of iteration in XQuery

CH.ADITYADec 4 2012 — edited Dec 4 2012
Hi,

I have below xquery block:

<Root>
{
for $line in $body/input/item
if($line eq "E") then (
return "1"
)
else("0")
}
</Root>

My task here is I have to iterate through all the line items and if I encounter "E" even in single case I have to exit imediately the for loop by returning "1", if it is not "E" for all the line items then at the end I shud return "0"

Here I'm not able to exit the for loop. Do we have any predefined keyword for exiting the loop?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2013
Added on Dec 4 2012
2 comments
3,919 views