IBM® Db2® Database Plug-in for Zowe CLI
IBM® Db2® Database Plug-in for Zowe CLI
The IBM® Db2® Database Plug-in for Zowe™ CLI lets you interact with Db2 for z/OS to perform tasks through Zowe CLI and integrate with modern development tools. The plug-in also lets you interact with Db2 to advance continuous integration and to validate product quality and stability.
Zowe CLI Plug-in for IBM Db2 Database lets you execute SQL statements against a Db2 region, export a Db2 table, and call a stored procedure. The plug-in also exposes its API so that the plug-in can be used directly in other products.
[[toc]]
Use cases
As an application developer, you can use Zowe CLI Plug-in for IBM DB2 Database to perform the following tasks:
- Execute SQL and interact with databases.
- Execute a file with SQL statements.
- Export tables to a local file on your computer in SQL format.
- Call a stored procedure and pass parameters.
Commands
For detailed documentation on commands, actions, and options available in this plug-in, see our Web Help. It is available for download in three formats: a PDF document, an interactive online version, and a ZIP file containing the HTML for the online version.
Software requirements
Before you install the plug-in, meet the software requirements in Software requirements for Zowe CLI plug-ins.
Installing
Use one of the following methods to install the the Zowe CLI Plug-in for IBM Db2 Database:
Installing from an online registry
If you installed Zowe CLI from online registry, complete the following steps:
-
Open a commandline window and issue the following command:
zowe plugins install @zowe/db2-for-zowe-cli@zowe-v1-lts
-
Address the license requirements to begin using the plug-in.
Installing from a local package
Follow these procedures if you downloaded the Zowe installation package:
Downloading the ODBC driver
Download the ODBC driver before you install the Db2 plug-in.
Follow these steps:
-
Download the ODBC CLI Driver. Use the table within the download URL to select the correct CLI Driver for your platform and architecture.
-
Create a new directory named
odbc_cli
on your computer. Remember the path to the new directory. You will need to provide the full path to this directory immediately before you install the Db2 plug-in. -
Place the ODBC driver in the
odbc_cli
folder. Do not extract the ODBC driver.
You downloaded and prepared to use the ODBC driver successfully. Proceed to install the plug-in to Zowe CLI.
Installing Xcode on MacOS
To install the Db2 CLI plug-in on MacOS, you need the command line tools, which can be obtained by installing Xcode from the App Store.
Note: On some versions of MacOS, you may receive the error xcrun: error: invalid active developer path
as shown below:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
If this occurs, a manual refresh of the command line tools is required by running the following commands:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Installing the plug-in
Now that the Db2 ODBC CLI driver is downloaded, set the IBM_DB_INSTALLER_URL
environment variable and install the Db2 plug-in to Zowe CLI.
Follow these steps:
-
Open a command line window and change the directory to the location where you extracted the
zowe-cli-bundle.zip
file. If you do not have thezowe-cli-bundle.zip
file, see the topic Install Zowe CLI from local package in Installing Zowe CLI for information about how to obtain and extract it. -
From a command line window, set the
IBM_DB_INSTALLER_URL
environment variable by issuing the following command:-
Windows operating systems:
set IBM_DB_INSTALLER_URL=<path_to_your_odbc_folder>/odbc_cli
-
Linux and Mac operating systems:
export IBM_DB_INSTALLER_URL=<path_to_your_odbc_folder>/odbc_cli
For example, if you downloaded the Windows x64 driver (ntx64_odbc_cli.zip) to C:\odbc_cli, you would issue the following command:
set IBM_DB_INSTALLER_URL=C:\odbc_cli
-
-
Issue the following command to install the plug-in:
zowe plugins install db2-for-zowe-cli.tgz
-
Address the license requirements to begin using the plug-in.