Details
| ID | DB2 |
|---|---|
| Provider | IBM |
| Category | Database |
| From Version | 6.0.0 |
| Docker Image | demisto/ibm-db2:1.0.0.9067966 |
| Supported Modules | Agentix XSIAM |
README
Integration to provide connectivity to IBM DB2 using the python ibm_db2 library.
This integration was integrated and tested with version 0.1 of DB2
Configure DB2 in Cortex
| Parameter | Required |
|---|---|
| Database host | True |
| Port | False |
| Database Name | False |
| Username | True |
| Password | True |
| Connection Arguments (ex: arg1=val1&arg2=val2) | False |
| Use an SSL connection | False |
| Use Persistent Connection | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
db2-query
Running a DB2 query command
Base Command
db2-query
Input
| Argument Name | Description | Required |
|---|---|---|
| query | The DB2 query to run. | Required |
| limit | The maximum number of results. Default is 50. | Optional |
| skip | The offset at which to start the result. Default is 0. | Optional |
| bind_variables_name | A comma separated list of names which will be replaced in query having ‘:<name>’. | Optional |
| bind_variables_values | A comma separated list of values corresponding to bind_variables_name or values in order of ‘?’ mark to be replaced in query. |
Optional |
Context Output
There is no context output for this command.
Command Example
!db2-query query="CREATE TABLE publishers(publisher_id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(publisher_id))"
Human Readable Output
Configuration parameters
host— Database host (required)port— Portdbname— Database Namecredentials— Username (required)connect_parameters— Connection Arguments (ex: arg1=val1&arg2=val2)ssl_connect— Use an SSL connectionuse_persistent— Use Persistent Connection
Commands (1)
-
db2-queryRunning a DB2 query command
## DB2 Integration This integration helps in executing raw queries with the help of command `query` parameter. ## Default Port If the `port` value is empty, a default port `50000` will be used. ## Connection Arguments Specify arguments for the configuration of an instance name-value pairs, for example: ``` ATTR_CASE=CASE_NATURAL&SQL_ATTR_CURSOR_TYPE=SQL_CURSOR_FORWARD_ONLY ``` ## Bind Variables There are two options to use to bind variables: 1. Use both bind variable names and values, for example: ``` "SELECT * from Table Where ID=:x" bind_variables_names="x" bind_variables_values="123" ``` 2. Use only bind variable values, for example: ``` "INSERT into Table(ID, Name) VALUES (?, ?)" bind_variables_values= "123, Ben” ``` **Note:** Make sure only values are used as in `bind_variables_name` and `bind_variables_values`, not the table column name.