Mediaflux TCL script: loop through query results with cursors








set size 100
set idx 1
set remaining 1

while { $remaining > 0 } {
    set r [asset.query :size $size :idx $idx :count true :where "namespace>=/test"]
    foreach id [xvalues id $r] {
         puts $id
    }
    set idx [expr { $idx + $size }]
    set remaining [xvalue cursor/remaining $r]
} 



No comments:

Post a Comment