Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%SQL] >  [ClassQueryResultSet]
Private  Storage   

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
9 12


Summary

Properties
%AtEnd %Column %CurrentResult %Data
%Message %Metadata %OutputColumnCount %PrivateTables
%QueryName %ROWCOUNT %ROWID %ResultColumnCount
%SQLCODE %StatementType %StatementTypeName

Methods
%ClassIsLatestVersion %ClassName %CloseCursor %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %Display %DisplayFormatted
%Extends %Get %GetData %GetMetadata
%GetParameter %IsA %IsModified %MoreResults
%New %Next %NextOutputValue %NextResult
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%Print %SendODBC %SerializeObject %SetModified
%ValidateObject Close Fetch FetchRows
Get GetData GetDataByName GetInfo
GetODBCInfo getSelectMode


Properties

• property %AtEnd as %Integer;
• property %Column as %String [ MultiDimensional ];
Duplicate of Data but subscripted by column number instead of name. This is used only by %SendOdbc to maintain values of columns orphaned by a full buffer.
• property %Data as %String [ MultiDimensional ];
Used to store the data returned from the resultset by column name. This can be accessed directly for better performance than the Get and GetDataByName methods. For example:
	; This slower code
	While result.Next() {
		Write result.Get("Name"),result.Get("Salary"),!
	}
	; Becomes this faster code
	While result.Next() {
		Write $get(result.Data("Name")),$get(result.Data("Salary")),!
	}
Note that because this 'Data' property is multidimensional, if there is no such column name as 'Salary' you will get an UNDEFINED error without the $get around it. If there are two columns with the same name in the result set then the second one will be the one referenced by the 'Data' property. If you need to refer to both of them, use the GetData and give the position of the column you want.
• property %QueryName as %RawString;
The name of the query to run.

Methods

• method %CloseCursor() as %Status
Closes the current result set cursor.
• method %DispatchGetProperty(pProperty As %String(MAXLEN=255))
Dispatch Get calls when the does not exist in the class descriptor. This implementation normalizes case and attempts to dispatch to the correct property, effectively making properties corresponding to column values case insensitive. Also, SQLCODE, ROWID and ROWCOUNT are case-normalized and dispatched to the correct property.
• method %Get(name As %String) as %String
Returns the value of the column with the name name in the current row of the result set.

If name is not a valid column name, this method throws a error.

• method %GetData(colnbr As %Integer = 0) as %Library.String
alias for new result set interface
• method %Next(ByRef sc As %Status) as %Integer
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the result set.
• method %SendODBC() as %Integer
Fetch and send a series of rows for the ODBC/JDBC server. For internal use only.
• method Get(name As %String) as %String
Returns the value of the column with the name name in the current row of the result set.

If name is not a valid column name, this method returns an empty string.
Using the Data multidimensional property to access the fields is faster than using this method call.

• method GetData(n As %Integer) as %String
Returns the value of column n in the current row of the result set.
• method GetDataByName(name As %String) as %String
Returns the value of the column with the name name in the current row of the result set.

If name is not a valid column name, this method returns an empty string.

Note: this method has been superceded by the equivalent Get method.



Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.