|
Class Reference
%Library.AbstractResultSet
|
|
![]() |
|||
Private Storage |
Abstract version of the resultset which specific implementations of result sets inherit from.
A result set is a type of result returned by executing either a SELECT statement or a CALL statement.
Please refer to
|
|
Properties | |||
---|---|---|---|
%Message | %Metadata | %PrivateTables | %ROWCOUNT |
%ROWID | %ResultColumnCount | %SQLCODE | Data |
RuntimeMode |
Subclasses | |
---|---|
%Library.RemoteResultSet | %Library.ResultSet |
|
Used to store the data returned from the resultset by column name. This can be accessed directly for more performance than theGet andGetDataByName as it avoids a method call. For example code that said:Note that as 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 theWhile 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")),! }GetData and give the position of the column you want.
Use this method to set the SQL runtime mode for the query to be executed. Setting the runtime mode for this ResultSet does not permanently change the $zu(115,5) value. Possible values mode are:
- 0 for LOGICAL mode.
- 1 for ODBC mode.
- 2 for DISPLAY mode.
- "" to use the process wide $zu(115,5) value.
|
alias for new result set interface
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.
Returns the value of column colnbr in the current row of the result set.
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the result set.
Closes the current result set cursor.
If the current query contains an object Id (based on the CONTAINSID parameter being set), return the column position of the object Id. Otherwise return 0.
Executes the current query.The arguments p1... supply the value of any parameters the query may have.
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. Look at updating the code to use the
Data multidimensional property to access the fields faster than using this method call.
Returns the number of columns in the result set.
Returns the column header for column n in the result set.
Returns the name of column n in the result set.
Returns the value of column n in the current row of the result set.
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.
The name of the extent that this query will return Id values from (based on the EXTENT parameter being set). Only returns a value if the query contains Id values.
If this query returns the object Id then return the oref you get from opening an object with this id.
Returns the number of input parameters for the current query.
Returns the name of input parameter n for the current query.
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the result set.
Use this method with dynamic queries to provide the query to be executed. In the case of the%DynamicQuery:SQL query, p1 is a string containing an SQL query. The query may contain parameters represented by ? characters within the query. The values of any parameters are supplied via theExecute method. For example:Set result=##class(%ResultSet).%New("%DynamicQuery:SQL") Do result.Prepare("SELECT Name,City FROM Person WHERE Name %STARTSWITH ? AND City = ?") Do result.Execute("A","Boston") While result.Next() { Write result.Data("Name"),result.Data("City"),! }
Returns true (1) if the ClassName and QueryName properties of this%ResultSet object refer to a valid class query. Otherwise it returns false (0).
This is a diagnostic function; it runs the specified query and prints the output to the console.