Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Automation Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Automation Anywhere Post messages and questions related to Automation Software here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2009, 11:34 AM
sthorne1271 sthorne1271 is offline
Junior Member
 
Join Date: Feb 2009
Location: Westport, NY
Posts: 10
Default Nested SQL Statements

I have a task that connects to an Oracle database and loops through records in a dataset. Within this outer loop I need to perform several SQL statements and dataset loops. Is this possible as it appears that once one of the inner SQL statement runs it basically clears my values from the outer recordset.

Connect to database
Execute SQL Statement: 'SELECT col.a, col.b from table1'... within 30 seconds
Start First Loop " Each row in a SQL query dataset"
Variable Operation : $Dataset Column(1)$ To $variable1$
Variable Operation : $Dataset Column(2)$ To $variable2$
Execute SQL Statement: 'SELECT col.c, col.d from table2 WHERE col.c = $variable1$'... within 30 seconds
Start Second Loop " Each row in a SQL query dataset"
'do work here based on values from second recordset
end loop
end loop
Disconnect from Database
Reply With Quote
  #2 (permalink)  
Old 03-20-2009, 09:57 PM
forumsupport forumsupport is offline
Senior Member
 
Join Date: Apr 2007
Posts: 1,342
Default

Hello,

We have created a sample task for you to show how you can automate the mentioned task. To run this task,

. Please copy attached .atmn file under location, 'C:\...\My Documents\Automation Anywhere\Automation Anywhere\My Tasks' folder.
. Copy .mdb file under C:\.
. Before running this task, please create a list variable, orders that reads value from a text file. To create a variable that read from text file, please follow below mentioned steps:

1. Go to Tools->Variable Manager in Automation Anywhere.
2. Click on 'Add New Variable'.
3. In 'Name' field, enter variable name i.e. orders.
4. Select 'Read from text file' radio button or option.
5. In 'Value' field, specify the path of text file i.e c:\TEST.txt.
6. Press 'Save' button.
7. Press 'Ok' button.

Hope that helps.
Attached Files
File Type: zip NestedSQL_sample.zip (37.5 KB, 10 views)
Reply With Quote
  #3 (permalink)  
Old 03-23-2009, 07:02 AM
sthorne1271 sthorne1271 is offline
Junior Member
 
Join Date: Feb 2009
Location: Westport, NY
Posts: 10
Default Nested SQL Statements

So based the sample task... it is not possible to have two recordsets open at the same time and be able to loop them both at the same time and create a SQL statement with the values from the outer recordset?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 03:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved