IDLdbRecordset

Superclasses | Creation | Properties | Methods | Version History

The IDLdbRecordset object contains a database table or the results from an SQL query.

Superclasses

None

Creation

To create a recordset object, a valid database object is required. Use the following IDL command to create a new recordset object:

RSObj = OBJ_NEW('IDLdbRecordset', DBobj, [, N_BUFFERS=integer] [, SQL=string | TABLE=string])

where DBobj is the object reference of the database object and either the SQL or the TABLE property must be specified.

N_BUFFERS

Set this keyword equal to the number of records to store per database read request in a rapid access memory location. When a IDLdbRecordset object requests records from the datasource it is associated with, the desired records are retrieved from the datasource and cached in the recordset object. The operation to request and transfer the desired records from the datasource can be fairly time consuming, which can impact performance of record access when a large number of records are being requested. Setting this to the optimal number of records can greatly increase IDLdbRecordset::MoveCursor performance and, thus, the overall speed of IDL DataMiner. A higher value is particularly useful, if you are looping through large IDLdbRecordset's with MoveCursor(/NEXT) or MoveCursor(/PREVIOUS) calls. A relatively low value might be called for, if your incremental Dataminer calls are searching for records that are widely dispersed in the target table. The default value is 10 records.

Transferring records from the datasource to the recordset object in a block can drastically increase performance, especially when accessing records in a sequential order. The N_BUFFERS keyword gives the user the ability to modify the size of the block of records the dataminer will transfer from the data sources when a request is being made by the recordset. Increasing the block/buffer size can dramatically increase record access time. You may need to experiment with different values to find the most efficient setting for your application.

SQL

A string that contains a valid SQL statement that selects records from the database. This SQL statement can be a Stored Procedure call that provides a return value.

Note
If the SQL keyword uses SQL statement syntax unrecognized by the DBMS or the ODBC driver, IDL throws an error that stops execution of the program if not caught and handled by the Dataminer programmer.

Note
If the SQL keyword uses an SQL statement that has acceptable syntax, but returns NULL data (because it has filtered out everything in the table it is referencing), then NO ERROR is thrown. The object returned is a valid IDL object. To determine the object returned was actually an "empty" recordset, you must test the recordset with a subsequent call of:

result = RSObj->MoveCursor(/FIRST)

if result eq 0 (or result ne 1), then the recordset returned by OBJ_NEW was an empty (or NULL) recordset.

TABLE

A string that contains the name of a table in the database. This table must be contained in the database referred to by RSObj.

Note
If the TABLE keyword references a table that does not exist, then IDL throws an error that stops execution of the program if not caught and handled by the Dataminer programmer.

Properties

Objects of this class have the following properties. See IDLdbRecordset Properties for details on individual properties.

Methods

Version History

5.0

Introduced