![]() |
![]() |
We are currently migrating this forum over to our HelpSystems domain. Please post all new threads in our new HelpSystems Community Portal. |
![]() |
|
![]() |
AutoMate Discussion | ![]() |
Topic Title: Open SQL Connection will not toggle within one task Topic Summary: Trying to open a different database based on agent machine Created On: 07/07/2015 08:11 AM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Valentineo, Sorry, this was my fault. From an earlier version I had a mis-spelling of the SQL Session variable in the first part of the if statement. When I fixed that everything worked. And I didn't need to set DBconnection explicitly once I found that so the BPA code is working the way it should. Thanks for the help. | ||||||||||
![]() |
||||||||||
To put this simply I am trying to connect to a different database based on the agent machine I am running on. We are doing this to have workflows run on dev/uat/prod environments based simply on the default agent for the workflow. I am trying to use Open SQL Connection to accomplish this. In order to use a different pre-defined connection string for each database I have to change the agent and edit the task through the workflow. When I run the workflow on the 2nd database machine defined I the error message below. This same code works if I set the default agent to ServerTwo. I want to know if one Session SQL Connection can point at different databases in the same task. The code is shown attached. Ignore the upcase stuff, I had to change the server names because they are our internal names.
Error Message: 7/7/2015 7:47:25 AM,Task 'dbTest' running on agent 'ServerOne' failed because: Session DBServerEnv could not be found. (Step 10) 7/7/2015 7:47:25 AM,Workflow 'dbTest' failed.
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) Edited: 07/07/2015 at 08:59 AM by TonGordon |
||||||||||
|
||||||||||
![]() |
||||||||||
Hello TonGordon,
By using the 'Set Variable' activity in conjunction with your IF logic we should be able to 'toggle' which DB to connect to within one task. Please try the attach code and let me know if this helps.
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder) ------------------------- ![]() Valentineo McGowan | Technical Consultant AutoMate | Division of HelpSystems HelpSystems, LLC | T: +1 213.738.6966 | F: +1.213.738.7665 |
||||||||||
|
||||||||||
![]() |
||||||||||
Valentineo,
Sorry, this was my fault. From an earlier version I had a mis-spelling of the SQL Session variable in the first part of the if statement. When I fixed that everything worked. And I didn't need to set DBconnection explicitly once I found that so the BPA code is working the way it should. Thanks for the help.
|
||||||||||
|
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.