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 02-18-2009, 05:59 PM
tburk tburk is offline
Junior Member
 
Join Date: Oct 2008
Posts: 26
Default SQL query is not returning @@IDENTITY

I can run a query through Microsoft SQL Server Management Studio that returns the identity value of the record just added, but when trying to execute the same query in Automation Anywhere the task fails somewhere in the 'Each Row in a SQL Query Dataset' loop. As you can see I have been trying to handle the errors by writing them to a log file but there is no logfile generated when this task fails.

Here is the query, INSERT INTO ProcessState (TaskID) VALUES ($TaskID$); select @@IDENTITY.

The atmn file is attached, please advise what is coded incorrectly.

Thank you.
Attached Files
File Type: atmn _BCBB_HALF.atmn (999 Bytes, 2 views)
Reply With Quote
  #2 (permalink)  
Old 02-19-2009, 06:50 AM
tburk tburk is offline
Junior Member
 
Join Date: Oct 2008
Posts: 26
Default

I made it work, but, was wondering if this is best practice. Instead of executing one query it was split into 2 queries where the 2nd query returns the identity value.

Quote:
Query1: INSERT INTO ProcessState (TaskID) VALUES ($TaskID$);
Query2: select @@IDENTITY;
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 10:28 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