Call Toll Free: 1-888-484-3535    

  Automation Anywhere - The Automation Software

Data Transfer & Data Migration -> T19 - Migrate/Import data from Database to Excel

Task Description: Query any database and transfer the results of the Query to Excel.

Solution
1.Create new task Click on New -> Task Editor.
2.Connect to the database Using the Database command from the Application category specify a connection string to connect to the Database Screenshot 1.

Connect to '<database connection string>.

3.Specify a SQL Query to get the data from database

Using the Database command from the Application category and selecting SQL Query Option specify a SQL Query

Execute SQL Statement: Select * From OrderMaster Where OrderDate $UserOpeator$ #$UserValue$#

$UserOperator$: It is a variable which is accepted by the user through the Prompt command.

$UserValue$: It is a variable which is accepted by the user through the Prompt command

4.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 returned by the query.

Inside the Loop Block, specify the Keystroke to paste the values of each column of the Dataset using the variable $Dataset Column(1)$ in excel cells.

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] Screenshot 2.

 
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.

Screenshot 1:

Screenshot 2:

 

E-Mail: Enter your email address to receive information about new products & offers from Tethys Solutions.


 PRODUCTS

 Automation Anywhere
   Standard & Premier
   Enterprise
 Workspace Macro Pro
 Workspace Macro
 Launch-n-Go
 Free Downloads
 Compare Products
 

 SOLUTIONS FOR

 Home & Home Office
 Business & IT
 Partners
 Developers
 

 SERVICES

 Ask The Expert
 Consulting Service
 

 PURCHASE

 BUY NOW
 Pricing
 Upgrades
 Our Guarantee

 SUPPORT

 FAQ & Examples
 Have a Question?
 Open A Support Case
 Forums
 

 QUICK LINKS

 Productivity Essentials
 Pre-defined Templates
 

 GENERAL

 Tell A Friend, Win a CD
 Affiliates
 Articles: Macro &
 Automation

 Get RSS Feeds

 Press & News
 Contact Us
Home |Site Map |Privacy Policy |About Us |Contact Us

Copyright © 2003-2008 Tethys Solutions, LLC. All rights reserved. Trademarks