How to iterate a local array with $QUERY() in a job ?
In Caché, it's possible to iterate a local array using $QUERY() :
set a("foo") = 50
set a("bar") = 30
set key = "a"
for
{
set key = $QUERY(@key)
quit:key=""
write key_" = "_@key
}
This code works perfectly, unless it's called in a job (eg: a routine called by the JOB command).
In that case, $QUERY will return an empty string. It's like the array cannot be referenced anymore by simply using it's name.
It works using $ORDER(a("")) but I would like to use $QUERY if possible (because my array has several dimensions and it would require several for loops).