Hello,

how can i get a %ResultSet from an other namespace? Here are two sample
methods:

// don't work
Method GetCompiledClasses(AStatement As %String) As %Library.ResultSet
{
 set OldNP=$ZUTIL(39)
 do $zu(5, "%CACHELIB")
 set res=##class(%Library.ResultSet).%New("%DynamicQuery.SQL")
 do res.Prepare(AStatement)
 do res.Execute()
do $zu(5, OldNP)
 Quit res
 }

// a simple string value works
Method GetCompiledClasses(AStatement As %String) As %String
{
set s = ""
  set OldNP=$ZUTIL(39)
 do $zu(5, "%CACHELIB")
 set res=##class(%Library.ResultSet).%New("%DynamicQuery.SQL")
 do res.Prepare(AStatement)
 do res.Execute()
 if res.Next()
 {
  set s = res.Data(AName)
 }
res.%Close()
do $zu(5, OldNP)
 Quit s
}

In the upper sample i have tried to quit the complete resultset - but this
don't work. If i use a simple string value as result (second sample), i can
access the value in my own namespace context sucessfully. Why don't works
the first one and have anybody a solution of my problem?

Best regards,
Falko Rotter



Reply via email to