Use the SQLDBS routine to call
DB2® APIs
with the following syntax:
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 DB2 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 DB2 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.
Note: For information
about the supported versions of the REXX programming language, see: "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).
Calling a DB2 API using SQLDB2
is equivalent to calling the CLP directly, except for the following:
- The call to the CLP executable is replaced by the call to SQLDB2
(all other CLP options and parameters are specified the same way).
- The REXX compound variable SQLCA is set after calling the SQLDB2
but is not set after calling the CLP executable.
- The default display output of the CLP is set to off when you call
SQLDB2, whereas the display is set to on output when you call the
CLP executable. Note that you can turn the display output of the CLP
to on by passing the +o or the -o- option
to the SQLDB2.
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
Notes on DB2 APIs Supported by SQLDB2: - 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.
Note: Although the SQLDB2 routine is intended to be used only for
the DB2 APIs listed above, it
can also be used for other DB2 APIs
that are not supported through the SQLDBS routine. Alternatively,
the DB2 APIs can be accessed
through the CLP from within the REXX application.