Query is the most important concept of DALE as well as in ODBC. Queries give applications the opportunity to modify data in the database, submit requests, perform administrative operations and so on. The SIMPLE_QUERY class represents the notion of an abstract ODBC query:
What's a common in all queries of any kind is the capability to be executed on some database. The considered class has the execute feature for this purpose. One of preconditions for this feature requires the query to be already attached to an open database. An alternative is the execute_on method which allows to attach the query to a database and execute it immediately.
Let's suppose, you have a query already executed. The following depends on a type of that query. Roughly speaking, it is possible to consider two types of a query: an action query and a selecting query. Goal of the first one is to change something in the database. Query of this type either doesn't return any results or, what's more often, returns a report of its activity which you can obtain via the no_affected_rows feature. For example, a SQL DELETE statement is the typical action query which returns the number of deleted rows.
Goal of a selecting query is to obtain from database some data in a form of set of records. The most popular selecting query is a SQL SELECT statement.
The SIMPLE_QUERY class defines an interface to both types of a query. However, if the execute and execute_on features plus no_affected_rows are quite enough for action query, the selecting query needs the possibility to obtain the results after execution. The feature recordset is designed for this purpose which delivers a RECORDSET object filled up by selected records, if any. See the RECORDSET class description below to find out how to manipulate with those records.