Recordset is a raw data access object that enables you to select data from the database, navigate through the result set, and manipulate user tables, which are not exposed by the DI API. The main method of this object is DoQuery that enables you to run SQL queries with any DML action in its query string.
Browsing Mechanisms
The Recordset object includes two browsing mechanisms: the first mechanism applies to result sets that contain only one row (by the use of Select Top), which will retrieve only one record each time. Otherwise, the browsing will be performed on existing result set only.
DML Operations on Database Tables
The Recordset object allows the following Data Manipulation Language (DML) operations: UPDATE, INSERT, and DELETE.
DML operations are acceptable with the Recordset object for user tables only. For other business objects use only the relevant DI objects and not the Recordset object. Any DML operations on system tables pose a high risk for data corruption, and will not be supported. Use at your own risk.
Before the Recordset object executes an SQL query, it validates the user permission (same user permission as in SAP Business One). Otherwise, the SQL query is blocked.
Blocking DDL Actions
The following Data Definition Language (DDL) actions are blocked: CREATE, DROP, ALTER, and TRUNCATE. The reason for that is, when upgrading the SAP Business One application, it ignores user tables that are not created using the DI meta data objects (UserTablesMD and UserFieldsMD).
Limitation
Only one expression can be specified in the select list when the sub-query is not introduced with EXISTS.
Related Topics
| Recordset Sample (Visual Basic) | Copy Code | |
|---|---|---|
| ||











~188.gif)
