| Qore DbDataProvider Module Reference 2.2

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
DbDataProvider::DbSelectBulkRecordInterface Class Reference

Defines the record iterator class for Table-based iterators. More...

`#include <DbSelectBulkRecordInterface.qc.dox.h>`

## Public Member Functions
| constructor (int block_size, AbstractDatasource ds, *hash< auto > where_cond, hash< auto > select_options)
| creates the iterator
| constructor (int block_size, bool release_transaction, AbstractSQLStatement stmt)
| Creates the iterator.
| destructor ()
| rolls back the transaction if a transaction lock was acquired in the constructor and keepTransactionLock() was not called
*hash< string, AbstractDataField > | getRecordType ()
| Returns the record description, if available.
| keepTransactionLock ()
| Ensures that no rollback is performed when the object is destroyed.

## Protected Member Functions
hash< string, list< auto > > | getValueImpl ()
| Returns a hash of lists according to the block size.

## Private Attributes
bool | release_transaction
| release the transaction with a rollback in the destructor?
AbstractSQLStatement | stmt
| the statement being iterated

## Detailed Description

Defines the record iterator class for Table-based iterators.

## Member Function Documentation

## ◆ constructor() [1/2]

DbDataProvider::DbSelectBulkRecordInterface::constructor | ( | int | block_size,
|  | AbstractDatasource | ds,
|  | *hash< auto > | where_cond,
|  | hash< auto > | select_options )

creates the iterator

Parameters

  block_size | the number of records in a read block; must be a positive number
  ds | the datasource to use
  where_cond | must be empty; an exception will be thrown if search conditions are passed to this constructor
  select_options | search options; assumed to have already been processed for validity before this call; contains: `sql` (required): the SQL query `args` (optional): a list of bind arguments to sql

Exceptions

  DBSELECT-BULK-ERROR | where_cond must be empty

## ◆ constructor() [2/2]

DbDataProvider::DbSelectBulkRecordInterface::constructor | ( | int | block_size,
|  | bool | release_transaction,
|  | AbstractSQLStatement | stmt )

Creates the iterator.

Parameters

  block_size | The number of records in a read block; must be a positive number
  release_transaction | Should the transaction be release in the destructor
  stmt | The SQL statement to iterate; must be already prepared

## ◆ getRecordType()

*hash< string, AbstractDataField > DbDataProvider::DbSelectBulkRecordInterface::getRecordType | ( |  | ) |

Returns the record description, if available.

Returns
  the record type of the query results

## ◆ getValueImpl()

hash< string, list< auto > > DbDataProvider::DbSelectBulkRecordInterface::getValueImpl | ( |  | ) |
| protected

Returns a hash of lists according to the block size.

Exceptions

  INVALID-ITERATOR | the iterator is not pointing at a valid element

Note
  This call moves the internal record pointer forward, therefore multiple calls of this methods will return different results as long as data is available