%XDBC.Gateway.JDBC.ResultSet
class %XDBC.Gateway.JDBC.ResultSet extends %XDBC.Gateway.ResultSet
FOR INTERNAL USE - do not invoke directlyMethod Inventory
- %Display()
- %Get()
- %GetData()
- %Next()
- %OnNew()
- %Print()
- BeforeFirst()
- Close()
- Get()
- GetBuffer()
- GetData()
- GetFetchSize()
- GetMetaData()
- GetObject()
- GetRow()
- GetRows()
- GetString()
- IsBeforeFirst()
- Next()
- SetFetchSize()
- WasNull()
- getrsmd()
Methods
If this method returns an error then the object will not be created.
It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:
Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.
Write the current row to the current device. An optional column delimiter can be specified. No formatting is applied other than writing pDelimiter between column values. This can be useful for exporting result set data to tab delimited files.
For example:
set sql = "select name,home_street,home_city,home_state,home_zip from sample.person" set rset = ##class(%ResultSet.SQL).%Prepare(.sql,.err,"") if '$Isobject(err) { set file="c:\temp\names.asv" open file:"WNS" use file while rset.%Next() { do rset.%Print($char(9)) } close file }
Example data:
Cornell,Ezra M. | 340 Franklin Court | Sarasota | NY | 12866 |
Huff,Stephen A. | 548 Washington Blvd | Brownfield Center | MD | 53436 |
Sands,Jeep Q. | 7298 Washington Drive | Xavier | WY | 23685 |
If colname is not a valid column name, this method throws a error.
For example, suppose rset.%GetRows(10,.tenrows,.sc) is called:
- If there are more then 10 rows remaining to be fetched from the result set, tenrows=10, tenrows(1)=$lb(first row's contents), ..., tenrows(10)=$lb(tenth row's contents), and %GetRows() will return 1.
- If there are 5 rows remaining to be fetched from the result set, tenrows=5, tenrows(1)=$lb(first row's contents), ..., tenrows(5)=$lb(fifth row's contents), and %GetRows() will return 0.
- If there are 0 rows remaining to be fetched from the result set, tenrows=0 and %GetRows() will return 0.
This implementation is overridden by classes that implement the result set interface.
Signature/behavior here to match that of %SQL.StatementResult:%GetRows()
Inherited Members
Inherited Properties
- %CurrentResult
- %Message
- %OutputColumnCount
- %ROWCOUNT
- %ROWID
- %ResultColumnCount
- %SQLCODE
- %StatementType
- %StatementTypeName
Inherited Methods
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %SerializeObject()
- %SetModified()
- %ValidateObject()