The remote query and stored procedure adapter enables some unique capabilities of the DB2 Everyplace database engine. The following sections detail the requirements and techniques for using the remote query and stored procedure adapter in a DB2 Everyplace application.
Passing parameters
DB2 Everyplace supports calling stored procedures on a remote DB2 server through the CLI interface. The client application uses the CALL statement to run the remote stored procedure. The CALL statement names the procedure to be called and specifies its parameters. The following types are supported: INTEGER, SMALLINT, DECIMAL, CHAR, VARCHAR, DATE, TIME, TIMESTAMP and BLOB.
Using the result set
Result sets are a useful way to retrieve data from a stored procedure. If a client application runs a stored procedure that generates a result set, it can then use the regular CLI functions such as SQLFetch() and SQLGetData() to retrieve the data. DB2 Everyplace does not support multiple result sets.
Current limitations
DB2 Everyplace does not support multiple local database connections. DB2 Everyplace supports one connection to the local database and one connection to the remote database with some limitations. The application must connect to the local database first (if a local connection is needed), then connect to the remote database (if a remote connection is needed). The allocated connection handles should be freed together.
User should allocate only one statement handle for the remote connection.
If the AUTOCOMMIT property of an DB2 Everyplace application is set to "off" on either the local or remote connections, the application must not call a remote stored procedure that returns a result set. This is because temporary tables will be created during such a remote stored procedures call, and the subsequent data definition statements will trigger errors during a transaction.
Supported platforms
The remote query and stored procedure adapter supports the Win32 and Palm OS client platforms. The remote query and stored procedure adapter requires that the stored procedures are registered to DB2.
Programming tips