Apps
IBM DB2
21 min
learn how to connect engini to ibm db2 using engini’s ibm db2 activities, you can create, get and update records to manage and define databases getting started with ibm db2 prerequisites a ibm db2 account add a connection to ibm db2 in engini enter your engini account at https //app engini io navigate to connections page by clicking on the connections on the left sidebar or by clicking https //app engini io/connections click on the add connection option located at the topbar choose ibm db2 option from the available applications enter the following details in the “add connection” form and press save connection name enter a unique and descriptive name for this connection this name will help you identify and manage the connection in your engini account “ibm db2” by default connection method direct access dns name provide the name of the dsn port specify the port number that the ibm db2 server is listening on database name provide the name of the specific database within the ibm db2 server that you want to connect to username enter the username associated with your ibm db2 this username should have the necessary permissions to access and interact with the database password enter the corresponding password for the provided username make sure the password is accurate to establish a secure connection ccsid specify the ccsid used by your ibm db2 database instance this value must match the character set configured on the database server relevant only for cloud communication channel time zone select the time zone of your ibm db2 server this is used to correctly interpret date and time values returned from the database communication channel choose the appropriate connection type based on your setup cloud if you are connecting to a database hosted in a cloud environment, select “cloud” opa if your database is on premises and you are using an on premises agent (opa) for the connection, select “opa” in this case, an additional field will appear on prem agent choose the specific on premises agent that you want to use for this connection if you have multiple agents configured dsn dsn – for odbc connections, you must have a data source name (dsn) creating data source names (dsn) – ibm documentation dsn name provide the name of the dsn username enter the username associated with your ibm db2 this username should have the necessary permissions to access and interact with the database password enter the corresponding password for the provided username make sure the password is accurate to establish a secure connection communication channel choose the appropriate connection type based on your setup cloud if you are connecting to a database hosted in a cloud environment, select “cloud” opa if your database is on premises and you are using an on premises agent (opa) for the connection, select “opa” in this case, an additional field will appear on prem agent choose the specific on premises agent that you want to use for this connection if you have multiple agents configured time zone – defines the time zone used for all date and time values when reading from or writing to the database communication channel – specifies how the connection communicates with ibm db2 (for example, via cloud or on premise infrastructure) save settings – saves the connection configuration and applies the selected settings note after clicking “save”, a window will prompt you to select database objects from available tables/views/stored procedures you can select the databases you want to use by marking the corresponding checkboxes of the tables/view/stored procedures you intend to utilize subsequently, you can perform various activities within your workflow and access the data stored within these selected tables/views/stored procedures actions create record table click on the empty field and the tooltip will pop up showing all the tables you can use all available tables will be accessible and you can select the specific table for the new record you create add field by clicking the “add field” button, you can choose how to fill in the various fields in the record you are creating you can add one field or more to the activity definitions choose from the drop down the field you want to fill click on the empty field to the right of the drop down to be shown the tooltip with all the options you can use to fill the field you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps 1 3 for all the fields you want to populate keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures get records get records from a specified table/view table/view click on the empty field and the tooltip will pop up showing all the tables/views you can use all available tables/views will be accessible and you can select the specific tables/views of the records you want to get top you can set the number of rows you want to retrieve from the table or view this parameter limits the result set to the specified number of records, with the default being 100 offset if you want to skip a certain number of rows before retrieving data, you can set the offset value the default is 0, meaning no rows are skipped add filter by clicking the “add filter” button, you can specify which records will be returned from the get results you can add one filter or more to the activity definitions choose from the drop down the field you want to filter by select the condition you want the record to meet for the selected field click on the field to show the tooltip with all the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) add sorting you can specify sorting criteria for the retrieved data sorting helps you order the records based on specific columns, such as ascending or descending order keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures update record table click on the empty field and the tooltip will pop up showing all the tables you can use all available tables will be accessible and you can select the specific table of the record you want to update add field by clicking the “add field” button, you can choose how to fill in the various fields in the record you are creating you can add one field or more to the activity definitions choose from the drop down the field you want to fill click on the empty field to the right of the drop down to be shown the tooltip with all the options you can use to fill the field you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps 1 3 for all the fields you want to populate keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures delete records table click on the empty field and the tooltip will pop up showing all the tables you can use all available tables will be accessible and you can select the specific table of the record(s) you want to delete add filter by clicking the “add filter” button, you can specify which records will be returned from the get results you can add one filter or more to the activity definitions choose from the drop down the field you want to filter by select the condition you want the record to meet for the selected field click on the field to show the tooltip with all the options you can choose you can populate the field in one of the following options property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) static value – number / string when using strings, you need to surround them with single quotes (‘) keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures create batch of records this activity iterates over a selected data list and for each record in the data list create records for a designated table corresponding to the specified data list data list click on the empty field next to the data list label and the tooltip will popup showing only previous activities than contains data lists from which you can choose choose a data list to iterate on table click on the empty field and the tooltip will pop up showing all the tables you can use all available tables will be accessible and you can select the specific table for the new records you create add field by clicking the “add field” button, you can choose how to fill in the various fields in the record you are creating you can add one field or more to the activity definitions choose from the drop down the field you want to fill click on the empty field to the right of the drop down to be shown the tooltip with all the options you can use to fill the field you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps 1 3 for all the fields you want to populate keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures get records batch this activity iterates over a selected data list and for each record in the data list retrieves records from a designated table corresponding to the specified data list data list click on the empty field next to the data list label and the tooltip will popup showing only previous activities than contains data lists from which you can choose choose a data list to iterate on table click on the empty field and the tooltip will pop up showing all the tables you can use all available tables will be accessible and you can select the specific table of the record(s) you want to get top you can set the number of rows you want to retrieve from the table or view this parameter limits the result set to the specified number of records, with the default being 100 add filter by clicking the “add filter” button, you can specify which records will be returned from the get results you can add one filter or more to the activity definitions choose from the drop down the field you want to filter by select the condition you want the record to meet for the selected field click on the field to show the tooltip with all the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) add sorting you can specify sorting criteria for the retrieved data sorting helps you order the records based on specific columns, such as ascending or descending order keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures update batch of records this activity iterates over a selected data list and for each record in the data list updates records from a designated table corresponding to the specified data list data list click on the empty field next to the data list label and the tooltip will popup showing only previous activities than contains data lists from which you can choose choose a data list to iterate on table click on the empty field and the tooltip will pop up showing all the tables you can use all available tables will be accessible and you can select the specific table of the record(s) you want to update add filter by clicking the “add filter” button, you can specify which records will be returned from the get results you can add one filter or more to the activity definitions choose from the drop down the field you want to filter by select the condition you want the record to meet for the selected field click on the field to show the tooltip with all the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) add field by clicking the “add field” button, you can choose how to fill in the various fields in the record you are creating you can add one field or more to the activity definitions choose from the drop down the field you want to fill click on the empty field to the right of the drop down to be shown the tooltip with all the options you can use to fill the field you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps 1 3 for all the fields you want to populate keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures execute customized sql the “execute customized sql” activity is an activity that allows you to interact with a ibm db2 system by running custom sql queries or commands within your workflow sql in the sql text field, you can write and enter your own sql queries, which are structured commands that define what you want to do with the data in the ibm db2 system these queries can include operations like data retrieval, modification, or database management keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures execute procedure the “execute procedure” activity is an activity that allows you to interact with a ibm db2 system by running stored procedures within your workflow procedure name you need to specify the name of a stored procedure that exists within your ibm db2 database a stored procedure is a pre defined, reusable set of ibm commands that are stored in the database and can be executed on demand add field by clicking the “add field” button, you can choose how to fill in the various fields in the record you are creating you can add one field or more to the activity definitions choose from the drop down the field you want to fill click on the empty field to the right of the drop down to be shown the tooltip with all the options you can use to fill the field you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps 1 3 for all the fields you want to populate keep connection alive until complete – keeps the database connection open until the stored procedure finishes running, ensuring the execution completes successfully and the full result is returned, especially for long running procedures