Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


whipdancer
2011-11-11T20:50:19Z
Hello -

I am trying to use the standard output from a SQL task in the body of an email. The email sends correctly, but instead of the query results, I get an error message:


"[Error in SetVariables, string: {TASK(caf97553-5e66-4f99-85aa-8b47812073cc,StdOut)}, err: Array cannot be null.
Parameter name: bytes]"


This would indicate to me that the SQL task is where the error is coming from - however, I know the SQL in question works. I've tried using the query directly as SQL text as well as using a Stored Procedure.

Here is the SQL:

SELECT woh.WorkOrderNo, convert(varchar, woh.CompleteDate, 106) AS [DD-MON-YYYY], isnull(nt.[Text], ' ') as Notes
FROM dbo.tmfWorkOrdHead_HAI woh LEFT JOIN dbo.tmfNotesText_HAI nt
			on woh.NotesKey = nt.NotesKey 
where woh.Complete=1
and woh.CompleteDate > dateadd(day, -2, '10-24-2011')
ORDER by len(nt.[Text]) ASC, woh.WorkOrderNo ASC


Is the error related to how the output is formatted (under the output settings tab)? I'm using the Pipe delimiter and crlf for new line.

Thanks,
Trent
Sponsor
Forum information
Support
2011-11-11T23:41:19Z
Hi,

the problem might be a conflict with the parameter delimiter which is comma "," and the fact that you use comma in the actual SQL string. Try using our alternate pipe "|" separator like this instead:

{TASK(caf97553-5e66-4f99-85aa-8b47812073cc|StdOut)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
whipdancer
2011-11-14T13:30:43Z
I tried using the pipe in place of the comma as described - I still get the same error.

Anything else I can try?
Support
2011-11-14T20:56:15Z
Could you attach the actual output to a file here?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
whipdancer
2011-11-14T20:58:53Z
The SQL output? Or the email output?
Support
2011-11-14T20:59:50Z
The SQL output. It is probably something in that output that consired "garble" to VisualCron. You know that you can control the way it outputs the SQL?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
whipdancer
2011-11-14T21:06:39Z
Yes, I've tried to output a single string of text, as well as output a complete multi-record set - using the delimiters per line ( pipe & crlf, comma & crlf, nothing & comma).

I had a co-worker try the job and it worked for him with no errors. I then opened it back up, changed a recipient and got the error again. My co-worker then got the error as well.

I then changed the recipient list and made sure to end the list with the delimiter (we are using ; as the delimiter). Worked once, then errored on subsequent tests. Closed out the desktop client completely, re-launched and re-opened the task in question - it works.

Now, if I get the error it seems to clear up if I close out the client and re-launch - but only if the recipient list for the email ends with the delimiter (or so it seems).

I can attach the output from the SQL, as well as the email if needed.
Support
2011-11-14T21:15:20Z
Please attach the sql output.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
whipdancer
2011-11-14T21:19:07Z
Here is the SQL output file.
File Attachment(s):
sql_output.txt (10kb) downloaded 76 time(s).
Support
2011-11-14T21:26:42Z
Are you sure that you refer back to the right Task?

If the SQL Task is the Task before the Email Task then please try with this Variable instead:

TASK(PrevTask|StdOut)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
whipdancer
2011-11-14T21:48:24Z
Yes, the SQL task is the task immediately before the email. I will try that variable instead.

EDIT: That variable works without any issues so far. Looks good after many tests. Thanks!
pbunyon99
2012-01-10T00:53:11Z
Henrik, this solution worked PERFECT... I did make sure to
have both the leading and trailing curly bracket.

For clarification... Can you tell me is this in the documentaion ?
Will this variable be available on the variable list in the future ?

Thanks Sooo much I needed a quick fix, and I got it.

Visual Cron is great !

Paul.
Support
2012-01-10T07:28:40Z
Originally Posted by: pbunyon99 

Henrik, this solution worked PERFECT... I did make sure to
have both the leading and trailing curly bracket.

For clarification... Can you tell me is this in the documentaion ?
Will this variable be available on the variable list in the future ?

Thanks Sooo much I needed a quick fix, and I got it.

Visual Cron is great !

Paul.



We are currently updating our documentation about this. This Variable is in the list in a way that you can always select the PrevTask alternative like in the screen shot.
Support attached the following image(s):

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top