Open SQL and the Standard API
As you can see from
A Summary of the Open SQL Classes, the Open SQL interface is smaller and more specialized than the standard interface of the DB Interface Module. It includes only those classes necessary to encapsulate an SQL statement (
RWDBOSql), to encapsulate data bound to individual parameters or result columns on a statement (
RWDBTBuffer), and to provide row operations and semantics for collections of
RWDBTBuffers (
RWDBMultiRow).
The important point, however, is that the Open SQL interface is completely compatible with the standard interface. You can use Open SQL and the standard interface together in both new and existing projects. Furthermore, you don’t have to rewrite all your existing code to benefit from Open SQL. You can incorporate Open SQL into existing programs by simply identifying and rewriting those parts of your existing code that may benefit from the added performance and control that Open SQL provides.
Open SQL classes are completely integrated with the classes of the standard API. For example, class
RWDBOSql interacts with class
RWDBConnection, since a connection is the means of performing work with a database. When invoking
execute() on an
RWDBOSql, you specify a connection on which the SQL statement shall be executed.
Class
RWDBMultiRow allows
RWDBTBuffers and the data inside to be exchanged with code that uses the existing API. A single value or row of values from your
RWDBTBuffers can be converted into
RWDBValues or
RWDBRows for easy data exchange with your existing code. Also,
RWDBSchemas representing query results or database tables in your existing code can be used to automatically generate
RWDBTBuffers. In this way, you can get a head start on writing your database code with the Open SQL API.