Skip to main content

Object References

Object References

You can specify an object reference (OREF) to ZWRITE as either a variable or an expression. If you have specified an object reference, ZWRITE displays a value such as the following: variable=9@%SQL.Statement ; <OREF> or 9@%SQL.Statement ; <OREF> and also displays General Information, Attribute Values, and (when appropriate) Swizzled References and Calculated References for the properties of the object, one attribute per line.

Note:

The <OREF> identifier suffix may not be displayed when executing ZWRITE through a browser interface, because browsers interpret angle brackets as tags.

If the ZWRITE argument is an embedded object property, ZWRITE displays General Information and Attribute Values for the array elements of the container property, one attribute per line. The display format is the same as the %SYSTEM.OBJ.Dump()Opens in a new tab method.

The following example displays the OREF, followed by “general information”, “attribute values” and “swizzled references”:

  SET oref = ##class(%SQL.Statement).%New()
  ZWRITE oref

The following example displays the OREF, followed by “general information”, “attribute values”, and “calculated references”:

  SET doref=##class(%iKnow.Domain).%New("mytempdomain")
  DO doref.%Save()
  SET domId=doref.Id
  ZWRITE doref
  SET stat=##class(%iKnow.Domain).%DeleteId(domId)

The following examples displays the OREF, followed by “general information”, “attribute values”, “swizzled references”, and “calculated references”:

  SET poref=##class(Sample.Person).%OpenId(1)
  ZWRITE poref
  SET myquery = "SELECT TOP 2 Name,DOB FROM Sample.Person"
  SET oref = ##class(%SQL.Statement).%New()
  SET qStatus = oref.%Prepare(myquery)
    IF qStatus'=1 {WRITE "%Prepare failed:" DO $System.Status.DisplayError(qStatus) QUIT}
  SET rset = oref.%Execute()
  ZWRITE rset

For information on OREFs, see OREF Basics.

FeedbackOpens in a new tab