define variable hBuffer as handle no-undo.
define variable iTmp as integer no-undo.
do iTmp = 1 to extent(a):
if a[iTmp] <> '' then do:
create buffer hBuffer for table a[iTmp].
q:add-buffer(hBuffer).
end.
[i]q:query-prepare([I]preparestring[/I]).
q:query-open().
do while not q:query-off-end:
end.
/* cleanup */
do iTmp = q:num-buffers to 1 by -1:
delete object q:get-buffer-handle(iTmp).
end.
delete object q.