Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 2 (10.2) Part Number B14308-01 |
|
The OSqlStmt class represents a single SQL statement. OSqlStmt is a subclass of OOracleObject.
An OSqlStmt is opened by executing a query against an Oracle database in the form of a SQL statement. Any legal SQL statement is acceptable. The SQL statement should not be a query, but can use select clauses in some other kind of statement. If the SQL statement modifies the data accessed by an open dynaset, the dynaset is not guaranteed to see the change until it is Refreshed.
Note: Some kinds of SQL statements result in an implicit commit. Consult your Oracle documentation.
Open and Refresh methods automatically bind all relevant, enabled input parameters to the specified SQL statement. These methods use the parameter names as placeholders in the SQL statement. Refresh can improve the performance of SQL statement execution without reparsing the SQL statement.
When you open an OSqlStmt, you can set the following options:
Option |
Description |
---|---|
OSQLSTMT_NOBIND |
// do not use bindable parameters |
OSQLSTMT_DEFAULT |
// the default settings |
OSQLSTMT_FAILEXEC |
// forces an error when there is an error executing the sql statement |
OSQLSTMT_NONBLK |
//executes the sql statement in non-blocking mode |
By default, the Open method attempts to use available bindable parameters (see OParameter for more information on parameters). Therefore, when issuing a SQL statement that does not refer to any parameters, you can make the SQL statement more efficient by specifying nobind.
Construction and Destruction:
Attributes:
Operations:
Error Handling: