Calling Db2 APIs in REXX
Syntax for calling Db2 APIs in REXX.
CALL SQLDBS 'command string'
If a Db2 API you want to use cannot be called using the SQLDBS routine, you can still call the API by calling the Db2 command line processor (CLP) from within the REXX application. However, because the CLP directs output either to the standard output device or to a specified file, your REXX application cannot directly access the output from the called API, nor can it easily make a determination as to whether the called API is successful or not. The SQLDB2 API provides an interface to the Db2 CLP that provides direct feedback to your REXX application on the success or failure of each called API by setting the compound REXX variable, SQLCA, after each call.
Support for database application development in REXX.
You can use the SQLDB2 routine to call Db2 APIs using the following syntax:
CALL SQLDB2 'command string'
where 'command string'
is a string that can be
processed by the command-line processor (CLP).
Because the only REXX variable that is set after you call SQLDB2 is the SQLCA, you only use this routine to call Db2 APIs that do not return any data other than the SQLCA and that are not currently implemented through the SQLDBS interface. Thus, only the following Db2 APIs are supported by SQLDB2:
- Activate Database
- Add Node
- Bind for Db2 Version 1(1) (2)
- Bind for Db2 Version 2 or 5(1)
- Create Database at Node
- Drop Database at Node
- Drop Node Verify
- Deactivate Database
- Deregister
- Load(3)
- Load Query
- Precompile Program(1)
- Rebind Package(1)
- Redistribute Database Partition Group
- Register
- Start Database Manager
- Stop Database Manager
- These commands require a CONNECT statement through the SQLDB2 interface. Connections using the SQLDB2 interface are not accessible to the SQLEXEC interface and connections using the SQLEXEC interface are not accessible to the SQLDB2 interface.
- Is supported on Windows-based platforms through the SQLDB2 interface.
- The optional output parameter,
poLoadInfoOut
for the Load API is not returned to the application in REXX.