Intelligent Automation & Macro Software  

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

Automation Anywhere Server & Enterprise Post messages and questions related to Automation Anywhere Server or Automation Anywhere Enterprise here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-03-2011, 08:46 PM
remo.mills remo.mills is offline
Junior Member
 
Join Date: Aug 2011
Posts: 2
Default MS SQL connect / disconnect order

I inherited some lengthy scripts from a previous co-worker. I am now tasked with making some significant changes to the scripts. Part of the changes involve adding more calls to the db. I notice that in all the previously scripted db calls, the AA script connects to the db, then runs the sql statement that returns a dataset (table with a single row), then does stuff with the data, and then disconnects from the db.

Is this the required pattern? If I disconnect before attempting to work with the data in the dataset will that cause the dataset to clear? I would like to keep the db connection period as short as possible.

Thanks in advance for any ideas
Reply With Quote
  #2 (permalink)  
Old 08-04-2011, 04:52 PM
forumstaff forumstaff is offline
Senior Member
 
Join Date: Oct 2010
Posts: 521
Default

Hello remo.mills,

The following are the answers to your questions:

Yes, this is the required pattern as sql connection works on sessions. If we disconnect early, the session will be lost and you wont be able to find the data in the data set variable as that session gets expired.

If you want to work after disconnecting the database session, you will have to select "export to csv" from sql query command which will export all the sql data to the csv file and you can use that csv file by making use of "read from csv" command after disconnecting the database session.

Let us know if you have any doubts.

Thanks & Regards
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 02:00 AM.


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