📚 SAP Business One SDK Help

RecordsetEx Object
See Also  Members  Example

Description

RecordsetEx is a raw data access object that enables you to fetch data from the database table. The main method of this object is DoQuery, which lets you run SQL select queries in its query string.

Remarks

Browsing Mechanisms

The RecordsetEx object includes two browsing mechanisms. The first mechanism applies to result sets that contain only one row (by the use of Select Top); it retrieves only one record each time. With the second mechanism, the browsing is performed on the existing result set only.

Blocking DML Operations and DDL Actions

The following Data Manipulation Language (DML) operations are blocked: UPDATE, INSERT, DELETE, TRUNCATE, UPSERT, REPLACE, and MERGE.

The following Data Definition Language (DDL) operations are blocked: CREATE, DROP, ALTER, and RENAME.

Limitation

This object is for the SAP HANA database only. It does not support Microsoft SQL Server database usage.

When the sub-query is not introduced with EXISTS, only one expression can be specified in the select list.

As of SAP Business One 10.0, the DoQuery function can access the current logon company DB only. If you access Common DB, the DoQuery function will throw exception.

Example

RecordsetEx Sample (C#)Copy Code
SAPbobsCOM.RecordsetEx oRecordSetEx = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordsetEx); 
 
oRecordSetEx.DoQuery("select \"CardCode\", \"CardName\" from OCRD"); 
 
while (!oRecordSetEx.EoF) 
 { 
       SAPbobsCOM.BoFieldTypes type = oRecordSetEx. .GetColumnType(0); 
       var value = oRecordSetEx.GetColumnValue(0); 
 
       //By Alias 
       //SAPbobsCOM.BoFieldTypes type = oRecordSetEx. GetColumnType("CardCode"); 
       //var value = oRecordSetEx. GetColumnValue("CardCode"); 
 
       oRecordSetEx.MoveNext(); 
 } 

See Also