%Library.IProcedureContext
Class %Library.IProcedureContext Extends %SQL.StatementResult [ Abstract, System = 2 ]
Base procedure context interface
Properties
CurrentResult
Property CurrentResult As %RegisteredObject [ Internal ];
Holds oref of the current resultset currently bound. Deprecated - use %CurrentResult.
Error
Property Error As %SYSTEM.Error;
Methods
CurrentResultGet
Method CurrentResultGet() As %Library.RegisteredObject [ CodeMode = expression, Internal ]
CurrentResultSet
Method CurrentResultSet(value As %RawString) As %Library.Status [ CodeMode = expression, Internal ]
ErrorSet
Method ErrorSet(newvalue As %RawString) As %Status [ Internal, ServerOnly = 1 ]
NextResult
Method NextResult() As %RegisteredObject
Called to return the next resultset object. This also removes the reference to the existing object so it can cleanup and close itself
CloseCurrentResult
Method CloseCurrentResult() As %Status
Close the current resultset object, used to allow the cleanup code to run and the cursor to close
%ResultColumnCountGet
Method %ResultColumnCountGet() [ CodeMode = expression, Internal ]
%ProcCursorGet
Method %ProcCursorGet() [ Internal ]
%MoreResults
Method %MoreResults() As %Integer
%MoreResults() will serially bind the next result set to the result object cursor (implemented as %Next()). If a result set was previously bound to the result object cursor (referred to as the "procedural cursor" by the SQL Standard) then it will be unbound and the reference to that result set removed. Under normal circumstances the previously bound result set is destructed.
%Next
Method %Next(ByRef pStatus As %Library.Status) As %Library.Integer
Advance the procedural result set cursor to the next row. Returns 0 if the cursor is at the end of the result set or if an error was encountered. Errors are reported in dynamic SQL using the %SQLCODE and %Message properties of the statement result. An optional argument will contain a %Status value on return. This %Status value indicates success or failure of the %Next call but it should be considered to be a secondary error reporting interface, %SQLCODE being the primary error reporting mechanism. This implementation can be overridden by classes that implement the procedural cursor interface.
%Get
Method %Get(pColumnName As %String = "") As %Library.String [ CodeMode = expression ]
Returns the value of the column with the name pColumnName in the current row of the result set.
If pColumnName is not a valid column name, this method returns an empty string.
%GetData
Method %GetData(pColumnNumber As %Integer = 0) As %Library.String [ CodeMode = expression ]
Returns the value of column pColumnNumber in the current row of the result set.
%GetMetadata
Method %GetMetadata() As %SQL.StatementMetadata [ CodeMode = expression ]
Return the result set metadata as a %SQL.StatementMetadata instance.
%SendODBC
Method %SendODBC() As %Library.Integer [ CodeMode = expression, Internal ]
Fetch and send a series of rows for the ODBC/JDBC server. For internal use only.
%SendDelimitedRows
Method %SendDelimitedRows(pMaxRows As %Integer = 0, pDelimiter As %String = "", ByRef pReturnCount As %Integer = 0) As %Status [ CodeMode = expression, Internal ]
Fetch and send a series of rows for continuous query client. For internal use only.
%SendObjects
Method %SendObjects(pObjectCount As %Integer = 0, pLock As %Integer = 0) As %Library.Integer [ CodeMode = expression, Internal ]
%SendObjects iterates over the rows in the result set and calls object export (quick load) on each column that is present in ..%Objects. For internal use only.
%Print
Method %Print(pDelimiter As %String = " ") As %Status [ CodeMode = expression ]
Print the contents of the current row on the current device.
%DispatchGetProperty
Method %DispatchGetProperty(pProperty As %String(MAXLEN=255)) [ Internal ]
%DispatchSetProperty
Method %DispatchSetProperty(pProperty As %String, pValue As %String) [ Internal ]
Property dispatch method to catch references to virtual properties.
This should not be called directly.
%Display
Method %Display(pDelimiter As %String = {$Char(9)})
Display the contents of this object on the current device
%DisplayFormatted
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="") = "", pDelimiter As %String)
Display the contents of the %OutputValues() multidimentional property. 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
Name | Description |
---|---|
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. NOTE: pFormat of CSV/100 is not a true comma separated value, but instead behaves the same as TXT, displaying each %OutputValues() on a numbered line. |
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 InterSystems IRIS 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. |