Using Open SQL is somewhat more complicated than using the standard DBTools.h++ API. While the alternative interface may increase control and performance, it may also decrease portability and ease of coding. For this reason, Open SQL is not recommended for all users, but you should consider it for any of the following operations:
To execute an SQL statement with direct control over parameter bindings and/or output bindings
To manage your own memory for input or output data for an SQL statement
To use vendor-specific datatypes to eliminate the need for DBTools.h++ to convert data
You should use Open SQL only if:
You want to create your own SQL statements for your own particular database. If not, the existing DML classes in DBTools.h++, such as RWDBSelector and RWDBUpdater, provide SQL statements already.
You want to manage your own memory, or you want to explicitly specify the C++ datatype for input or output data. If not, the DML and result processing classes in DBTools.h++, such as RWDBResult and RWDBReader, provide memory management and datatyping already.
In summary, by using Open SQL, you obtain direct control over the SQL that is executed and the data that is bound to it. Some parts of your DBTools.h++ application may also achieve better performance. However, these benefits might not be worth the decreased maintainability and increased complexity that result from direct execution of SQL statements.
As a guideline, if you can identify specific, performance-intensive sections in an application that performs database access, you should consider coding those sections using Open SQL.
©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.