RPA | Database Command | Automation Anywhere - Part-10
Database Command | Database command is used to provide actions that are used to perform operations on the database. Through database command we can perform various operations such as reading data from the database, inserting, updating and deleting data from the database. Data in the database is stored in the form of rows and columns.
Database command provides various sub commands which are as follows:-
- Begin Database Transaction - This command is used to begin a database transaction to commit all database actions till End database transactions. The transaction will be rolled back to its original state if the transaction fails in between.
- End Database Transaction - This command is used to commit all database actions from the preceding "Begin Database transaction".
- Connect Command - This command is used basically to connect to a database. To connect to a database we need to pass the session name, connection mode which can be either default or user-defined, database type which can be either Microsoft SQL Server, MySQL, Microsoft Access, POSTSQL, SqLite, Oracle and finally pass the username and the password to connect to a database.
- Disconnect Command - This command is used to disconnect from the database that we used to connect to the database using the Connect Database command.
- Read From Command - This command basically "retrieves the data from the database". We need to pass the session name, then we need to "Enter the Select query or command to retrieve data from the database", give the number of records to be fetched from the database which is an optional field, then pass the time in which the query must be timed out which is again an optional field, then give the location of the file in which we will store the fetched records from the database, and lastly we can either append data to an existing file or we can overwrite data to an existing file.
- Run Stored Procedure - This command is used to run a stored procedure that is created in the database. It supports four types of database i.e. Microsoft SQL Server, Oracle, MySQL, and Postgresql.
- Export to Data Table - This command is used to basically export data from database to a user specified data table.We need to pass the session name, then we need to "Enter the Select query or command to retrieve data from the database", give the number of records to be fetched from the database which is an optional field, then pass the time in which the query must be timed out which is again an optional field and assign the output to the user-defined variable that we created of table data type.
- Manage Stored Procedure -This command is used to create, update and delete a stored procedure in the database.
- Insert/Update/Delete command - This command is used to either insert, update or delete the records from the database. In this we need to pass the session name, the query to insert/update/delete the records in the database and the time in which the query must be timed out.
Let's take a look at the code snippet to demonstrate the working of database command.
Good work
ReplyDeleteVery useful information!
ReplyDeleteThanks a lot
Useful..nice
ReplyDelete