OnError for SQL Task.

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.

OnError for SQL Task.

Postby LPrendergast » Wed Mar 13, 2013 5:13 pm

Hi, Iam trying to set a variable in the the onerror event of the SQL query task. BUt i cant seem to get the syntax right. I have a variable cslled GetFile and I want to set it to FAIL if any error occurs. But I cant figure out how to set the varible correctly, instead I get the following error:

[8003 - sql] Invalid value 'setVariable:[GetFile]=['FAIL']' for attribute 'onError' in element 'sql'


I think I tried every possible way of formating it with no luck.
LPrendergast
Verified User
 
Posts: 11
Joined: Tue May 26, 2009 8:54 am

Re: OnError for SQL Task.

Postby Support_Rick » Wed Mar 13, 2013 6:20 pm

LP,

Use the following syntax:

Code: Select all
<setVariable label="Set sqlError" name="sqlError" value="0" version="1.0" />
<sql label="Connect to Server" resourceId="${ JobServer }" version="1.0" onError="setVariable:sqlError=1">


You can set the values to whatever you want. I normally use 0 for "it worked" and numbers greater than 0 for "it didn't"
Rick Elliott
Sr. Product Specialist
(402) 944.4242
(800) 949-4696
Support_Rick
Support Specialist
 
Posts: 162
Joined: Tue Jul 17, 2012 2:12 pm

Re: OnError for SQL Task.

Postby LPrendergast » Thu Mar 14, 2013 5:18 pm

Rick, that worked by switching to 0 or 1. But I would still like to know how to pass a character string. Is tha possible?
LPrendergast
Verified User
 
Posts: 11
Joined: Tue May 26, 2009 8:54 am

Re: OnError for SQL Task.

Postby Support_Rick » Fri Mar 15, 2013 8:09 am

LP,

Try something like this:

Code: Select all
<project name="TestThis" mainModule="Main" version="2.0">

   <module name="Main">

      <setVariable label="Init Error Var" name="MyError" value="YepItWorked" version="2.0" />
      <sftp resourceId="Ricks Laptop sFTP" version="1.0" onError="setVariable:MyError=NopeItDidntWork">
         <put sourceFile="C:\Program Files\Linoma Software\GoAnywhere\userdata\keys\x509\gadirector-sample.p13" destinationDir="\" />
      </sftp>

      <print version="1.0">
         <![CDATA[
====================

Error:  ${MyError}

====================]]>
      </print>

   </module>

</project>
Rick Elliott
Sr. Product Specialist
(402) 944.4242
(800) 949-4696
Support_Rick
Support Specialist
 
Posts: 162
Joined: Tue Jul 17, 2012 2:12 pm


Return to Community Forum

Who is online

Users browsing this forum: No registered users and 1 guest