##class(%SQL.Statement).%ExecDirect() method not work

Caché, InterSystems IRIS

Hi Team,

When I use below statement , I got SQLCODE=0.

SET rs = ##class(%SQL.Statement).%ExecDirect(, "SELECT * FROM LISDB.ExternalUsers WHERE UserId = 83")

If I display above query using   Write (rs.%Display())  it gives me below result but   (rs.%Get("Prefix")) method give me null value.

Please help

  • 0
  • 0
  • 59
  • 0
  • 1

Answers

Maybe the "Next" method is missing.

Ex:

SET rs = ##class(%SQL.Statement).%ExecDirect(, "SELECT * FROM LISDB.ExternalUsers WHERE UserId = 83")

do rs.%Next()

write rs.%Get("Prefix")

If that doesn't work, put the command sequence you're running.