Hi Everybody
Oracle used : Release 11.2.0.3.0
After some days I gave up but I'm sure you have a solution.
I want to modify some elements, always the same element (same name), with using a string and the function tokenize. I use a for, but my problem is to know the index of the element to modify in the loop. I tried to use the function $position(), but without success. Maybe we can use an index but how, because in XQuery the variables are immuable.
Here an example :
update ingredients set sections=XMLQuery('copy $gr:=.modify(
let $values:="1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0"
for $i in $gr/ingredients/section/sub_section/ingredient/value_gr
return replace value of node $i with ora:tokenize($values,",")[5])
return $snf' passing sections returning content) where ingredient_id=601;
This request works, but obviously I want to change [5] by 1,2,3...
I think you see what I want.
Thanks in advance