| T19 - Migrate/Import data from Database to Excel |
| Task Description |
Query any database and transfer the results of the Query to Excel.
|
| Solutions |
 |
Create a new task
Click on New -> Task Editor |

Screenshot 1

Screenshot 2 |
 |
Connect to the database
Using the Database action specify a connection string to connect to the Database.
Connect to '<database connection string>. |
 |
Specify a SQL Query to get the data from database
Using the Database action and selecting SQL Query option specify a SQL Query.
Execute SQL Statement: Select * From OrderMaster Where OrderDate $UserOpeator$ #$UserValue$#
$UserOperator$ and $UserValue$ are variables that user can input when task runs. |
 |
Loop through all the rows of dataset
Using the Loop command and selecting "Each row in a SQL Query Dataset" option, you can Loop through each row of the result.
Inside the Loop block, use the $Dataset Column(1)$ to access the values.
Keystrokes: $Dataset Column(1)
Note: To access values of different columns in the dataset use the index 1,2,3, etc with the system variable $Dataset Column$.
Also specify the Keystroke command to move to the next cell in the Excel sheet
Keystrokes: [RIGHT ARROW] |
|
When you run this task, it connects to the database , retrieves a dataset & fills the cells of excel file with data fetched from database.
This tutorial demonstrates use of one of very powerful feature, 'Database' applications. Use this when you want to perform a task based on the data from any database. |
|
 |
| We started using this product to copy data from legacy system to new system. Now we use it just to do about anything automated. Countless hours saved. Thank you guys. |
- Jack Greenberg
|
| Read Customer Testimonies >> |
|