Home > Class Reference > ENSLIB namespace > %SQL.Manager.Messages

%SQL.Manager.Messages

class %SQL.Manager.Messages extends %SQL.CustomResultSet

Property Inventory (Including Private)

Method Inventory (Including Private)

Parameters

parameter %statementmetadata;
parameter %statementmetadata0;
parameter %statementmetadataext;
parameter %statementobjects;

Properties (Including Private)

property %currentRow as %Integer [ Private ];
Property methods: %currentRowDisplayToLogical(), %currentRowGet(), %currentRowIsValid(), %currentRowLogicalToDisplay(), %currentRowNormalize(), %currentRowSet()
property AtEnd as %Integer [ Private ];
Property methods: AtEndDisplayToLogical(), AtEndGet(), AtEndIsValid(), AtEndLogicalToDisplay(), AtEndNormalize(), AtEndSet()
property Message as %String (MAXLEN = 200);
Property methods: MessageDisplayToLogical(), MessageGet(), MessageIsValid(), MessageLogicalToDisplay(), MessageLogicalToOdbc(), MessageNormalize(), MessageSet(), MessagesBuildValueArray(), MessagesCollectionToDisplay(), MessagesCollectionToOdbc(), MessagesDisplayToCollection(), MessagesDisplayToLogical(), MessagesGet(), MessagesGetObject(), MessagesGetObjectId(), MessagesGetSwizzled(), MessagesIsValid(), MessagesLogicalToDisplay(), MessagesLogicalToOdbc(), MessagesNormalize(), MessagesOdbcToCollection(), MessagesSet(), MessagesSetObject(), MessagesSetObjectId()
property Messages as list of %String) [ Private ];
Property methods: MessagesBuildValueArray(), MessagesCollectionToDisplay(), MessagesCollectionToOdbc(), MessagesDisplayToCollection(), MessagesDisplayToLogical(), MessagesGet(), MessagesGetObject(), MessagesGetObjectId(), MessagesGetSwizzled(), MessagesIsValid(), MessagesLogicalToDisplay(), MessagesLogicalToOdbc(), MessagesNormalize(), MessagesOdbcToCollection(), MessagesSet(), MessagesSetObject(), MessagesSetObjectId()

Methods (Including Private)

method %Display(pDelimiter As %String = $Char(9))
Inherited description: Display the contents of this object on the current device
method %DisplayFormatted(pFormat As %String = -1, ByRef pFileName As %String(MAXLEN="")="", ByRef pMessages As %SQL.Manager.Messages = "", ByRef pFilesUsed As %String(MAXLEN="")=0, pTranslateTable As %String(MAXLEN="")="")

Display the contents of the result object. If formatted display is available then format the results using the requested format and, if appropriate, open the formatted results using the host OS. The output is directed to one or more files and messages are placed in a result set object. All file names used are returned in an array.


Parameters


NameDescription
pFormat

The format applied to the result content. This parameter is also used to determine the file name extension.

Supported formats are:

-1%Display() format
0XML
1HTML
2PDF (requires a renderer such as FOP)
99TXT
100CSV

If pFormat is specified as any number not listed above then it will default to TXT.

pFormat can also be specified as XML, HTML, PDF, TXT or CSV.

pFileName

The base file name to be used to generate actual file names used for output. If no value is specified then a file name will be generated, using the TEMP folder defined for the Cache instance. This value is not expected to include an extension. An extension is added to this value to form the actual file used. Also, if nested results exist then a number is appended to the file name specified to produce a unique name for each result.

pMessages

Instance of a system result set class. If no value is passed then the system message result class is instantiated. This parameter is passed by reference. It is up to the caller to process the result set oref that is returned. pMessages.Count() returns the number of messages contained in the result set. pMessages.%Display() will display the messages on the current device. pMessages.%DisplayFormatted() is also implemented and can be used to display the messages using the selected format.

pFilesUsed

This pass-by-reference parameter will contain the number of files used to display the result content and the name of each file. pFilesUsed is the number of files and pFilesUsed(file_number) is the name of the file. The sequence of the files is the same sequence as the results are processed. For simple result objects, there is a single file. For context objects that can contain result set sequences, the results are output in the order they are returned and the files used are present in pFilesUsed in that same order.

pTranslateTable

This is the translate table used for the output files when the format is CSV or TXT. This parameter is optional.


method %Next(ByRef sc As %Library.Status = $$$OK) as %Library.Integer
Advance to the next row in the result referenced by %ProcCursor. Returns 0 if the cursor is at the end of the result set. An optional argument contains a %Status value on return. This %Status value indicates success or failure of the %Next call. %SQLCODE is also set by %Next. This implementation is overridden by classes that implement the result set interface.
private method %OpenCursor() as %Library.Status
Implement code to open the cursor here. You may also define new formal arguments. Any arguments defined will be automatically added to the constructor interface and callers can specify actual arguments in the call to %New().
		method %OpenCursor(pBeginDate as %Date = "", pEndDate as %Date = "") as %Library.Status [ private ]
		{
			set ..BeginDate = pBeginDate
			set ..EndDate = $Select(pEndDate'="":pEndDate,1:$H)
			quit $$$OK
		}
Given the above example implementation of %OpenCursor, the following is a valid call to instantiate a new instance.
		set tResult = ##class(MyCustom.ResultSet).%New(,$H-30,$H-10)
To report an error from %OpenCursor just set ..%SQLCODE and %Message to appropriate values. To report no rows found, set %SQLCODE to 100. Errors are indicated by negative ..%SQLCODE values.
method %SetIterator(pRowNumber As %Library.Integer = 0) as %Library.Integer
method Count() as %Integer
method Insert(pMessage As %String(MAXLEN=200))

Inherited Members

Inherited Properties (Including Private)