ABAP - Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Native SQL →  ADBC - ABAP Database Connectivity →  CL_SQL_STATEMENT - Execution of SQL Statements → 

Queries

Queries can be executed using the following instance method from class CL_SQL_STATEMENT:

The method has a mandatory input parameter STATEMENT of type string that must be passed to a SELECT statement with correct syntax. As with DML statements, the method SET_PARAM can be used to bind ABAP data objects to place holders ?.

As the result of a query, a reference to an object of the class CL_SQL_RESULT_SET is returned in the return value RESULT_SET. The methods of this object allow access to the results set of the query. To retain the results set beyond the end of a database LUW, the input parameter HOLD_CURSOR of the EXECUTE_QUERY method can be filled with "X".

The class CL_SQL_RESULT_SET of the result object provides the following instance methods for reading the results sets into ABAP data objects:

Notes

Examples

See