From the description of your task, it will be easier to use the %ScrollableResultSet class.
Here is a small example:
try{ n $namespace s $namespace="ENS" s rs=##class(%ScrollableResultSet).%New() d rs.Prepare("query in ENS") d rs.Execute() d rs.%Save() s rsId=rs.%Id() w "rsId=",rsId,! k rs s $namespace="ONS" s rs=##class(%ScrollableResultSet).%OpenId(rsId) while rs.Next() { w rs.Data("your data"),! } }catch(ex){ }
- Log in to post comments