QueryCursor class | QSYS API Reference Guide
Estimated reading time: 4 minutes
Represents the SQL Query Cursor.
Namespace: ASNA.QSys.Runtime.JobSupport Assembly: ASNA.QSys.Runtime.dll
Inheritance: Object
Constructors
Name | Description |
---|---|
QueryCursor(DbConnection, String) | Initializes a new instance of QueryCursor class. |
QueryCursor(SqlPreparedStatement) | Initializes a new instance of QueryCursor class. |
QueryCursor(DbConnection, String, DBParm[]) | Initializes a new instance of QueryCursor class. |
QueryCursor(DbConnection, String)
Initializes a new instance of QueryCursor class.
QueryCursor(DbConnection, String)
Parameters
Type | Parameter name | Description |
---|---|---|
DbConnection | sqlConnection | SQL Connection. |
String | SelectStatement | SELECT statement. |
QueryCursor(SqlPreparedStatement)
Initializes a new instance of QueryCursor class.
QueryCursor(SqlPreparedStatement)
Parameters
Type | Parameter name | Description |
---|---|---|
SqlPreparedStatement | preparedStatement | Prepared statement initializer. |
QueryCursor(DbConnection, String, DBParm[])
Initializes a new instance of QueryCursor class.
QueryCursor(DbConnection, String, DBParm[])
Parameters
Type | Parameter name | Description |
---|---|---|
DbConnection | sqlConnection | SQL Connection. |
String | selectStatementWithParms | SELECT Statement (with parameters). |
DBParm[] | parameters | Parameter values. |
Properties
Type | Name | Description |
---|---|---|
QueryResults | QueryResults | Gets the Cursor’s Query Results. |
ScrollTypes | ScrollType | Gets the Cursor’s scroll type. |
String | selectStatement | Gets the SELECT statement. |
String | SelectStatement | Gets the SELECT statement. |
SQL_CommunicationsArea | SQLCA | The SQL Communications Area for the Cursor. |
Methods
Signature | Description |
---|---|
Close() | Closes the Cursor. Does not throw error if the cursor had not been opened. |
Fetch(Int32, FetchOrientation) | Fetches a row according to the orientation requested. |
FetchAbsolute(Int32, Int32) | Fetches rows until it gets to the indicated absolute row. |
FetchRelative(Int32, Int32) | Fetches rows in a relative way. |
Open() | Opens the Cursor. Throws exception if cursor already opened. |
Open(DBParm[]) | Opens the Cursor using the parameters passed in. |
SetSelectStatement(String) | Initializes a new instance of SetSelectStatement class. |
void Close()
Closes the Cursor. Does not throw error if the cursor had not been opened.
void Close()
bool Fetch(int expectedResults, FetchOrientation orientation)
Fetches a row according to the orientation requested.
bool Fetch(int expectedResults, FetchOrientation orientation)
Parameters
Type | Parameter name | Description |
---|---|---|
Int32 | expectedResults | Expected field count available after operation. |
FetchOrientation | orientation | Orientation specification. |
Returns
Type | Description |
---|---|
Boolean | True if the fetch was successful. |
bool FetchAbsolute(int expectedResults, int absoluteRow)
Fetches rows until it gets to the indicated absolute row.
bool FetchAbsolute(int expectedResults, int absoluteRow)
Parameters
Type | Parameter name | Description |
---|---|---|
Int32 | expectedResults | Expected row count read. |
Int32 | absoluteRow | Absolute row number. |
Returns
Type | Description |
---|---|
Boolean | True if the fetch was successful. |
bool FetchRelative(int expectedResults, int relativeRowCount)
Fetches rows in a relative way.
bool FetchRelative(int expectedResults, int relativeRowCount)
Parameters
Type | Parameter name | Description |
---|---|---|
Int32 | expectedResults | Expected number of rows read after operation. |
Int32 | relativeRowCount | Number of rows - from current row. |
Returns
Type | Description |
---|---|
Boolean | True if the fetch was successful. |
void Open()
Opens the Cursor. Throws exception if cursor already opened.
void Open()
void Open(DBParm[] parameters)
Opens the Cursor using the parameters passed in.
void Open(DBParm[] parameters)
Parameters
Type | Parameter name | Description |
---|---|---|
DBParm[] | parameters | The array of parameters. |
void SetSelectStatement(string statement)
Initializes a new instance of SetSelectStatement class.
void SetSelectStatement(string statement)
Parameters
Type | Parameter name | Description |
---|---|---|
String | statement | SELECT statement. |