DB Access Module for ODBC User’s Guide : Chapter 2 Technical Information : Stored Procedures
Stored Procedures
Stored procedures are encapsulated by the class RWDBStoredProc. The implementation of stored procedures in the DB Access Module for ODBC is subject to many restrictions due to a combination of the ODBC SQL grammar and the capabilities of the underlying driver.
Not all ODBC drivers support stored procedures. Applications using drivers that don't support stored procedures will produce RWDBStoredProc instances whose status is RWDBStatus::notSupported.
The DB Access Module for ODBC implements only a subset of the RWDBStoredProc functionality declared in the DB Interface Module. In particular, the two functions:
RWDBDatabase::createProcedure() and RWDBStoredProc::dropProcedure()
are not implemented and return a status of RWDBStatus::notSupported. It may be possible to use RWDBDatabase::executeSql() to create and drop procedures in a database specific manner.
RWDBStoredProc::text() is not supported and returns an empty RWCString.
Although output and input/output parameters are supported, several ODBC drivers silently fail to update parameters, despite the capabilities of the underlying database. Users are cautioned to look carefully into the support that the underlying driver offers in this area before relying upon this feature.
Instantiating an RWDBStoredProc Using Schema Data
The member functions:
 
RWDBDatabase::storedProc(RWCString, RWDBSchema, RWDBColumn)
RWDBDatabase::storedProc(RWCString, RWDBConnection, RWDBSchema,
RWDBColumn)
increase the performance of stored procedures by eliminating the usual parameter fetch required for instantiations. The schema must include the name and type of each parameter in the stored procedure. If there is a return value, a column must be provided with a name and the correct datatype.