Database package
- Updated: 2024/11/11
Database package
Databases support internal operations of an enterprise by storing a variety of data, such as sales transactions, product catalogs, inventories, and customer profiles. Use the Database package to connect to a database, begin a transaction, and manipulate the stored data by retrieving, inserting, updating, deleting, and exporting it to a CSV file.
Before you start
TRUE
or FALSE
values), then
the retrieved data will be referred to 0
and
1
, not TRUE
and
FALSE
.- Establish a connection with the database server using the Connect action.
- Choose from the following:
- Use the Read from action to retrieve records from the database. See Using the Read from action.
- If you are automating a task that involves making changes to the
database, insert the Begin database transaction
action, followed by the actions that
automate the changes.
This action ensures that all records are updated or deleted in their entirety, and prevents accidental updates or deletions of incomplete data if the bot encounters an error during run time.
- If you used the Begin database transaction action in this session, insert the End database transaction to commit the changes.
- Every set of database actions ends with the Disconnect action to terminate the connection to the database server.
- When you establish a connection with specific databases such as MySQL, you are required to provide a JDBC driver file from the Control Room, local device, or file variable. The file type input is not supported for API Task. Therefore, you will be unable to connect to MySQL databases. However, you can connect to PostgreSQL, MS SQL, MS Access, and SQLite, as the Database package already includes the JDBC driver jar file.
- Establishing a connection using the ODBC driver is not supported.
- Write data in a CSV file using the Read from action, as the file action is not supported for API Tasks.
Database data types
Data type | Value |
---|---|
Supported data types | Char, Varchar, Nvarchar, Number, Datetime, INT, Float, and Bit |
Unsupported data types |
|
Actions in the Database package
The Database package includes the following actions:
Action | Description |
---|---|
Begin database transaction | See Begin database transaction action. |
End database transaction | See End database transaction action. |
Connect | See Using Connect action for database. The Snowflake database using the ODBC driver is supported. |
Disconnect | See Disconnect action. |
Read from | See Using the Read from action. The Snowflake database using the ODBC driver is supported. |
Run stored procedure | See Using the Run stored procedure action. |
Export to data table | See Using the Export to data table action. The Snowflake database using the ODBC driver is supported. |
Manage stored procedure | See Manage stored procedure action. |
Insert/Update/Delete | See Insert/Update/Delete action. |