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


viper8
2011-01-28T17:48:58Z
Hello all,

I have a zip file that I need to "read" into a database table. Is it possible to read a zip file and capture the output in standard output? Or does it not work properly with zip files with special characters?

The way I have it setup now is with 2 tasks.

1) Read Task - read zip file
2) SQL Task - use SQL query to read the standard output from the previous task and insert the data into the database.

INSERT INTO AttachmentValue
SELECT TOP 1 AssetId, AssetTypeId, 'rptTEMADeduct', CAST('{TASK(86bae973-2c6f-40bf-9655-59d8830503f6,StdOut)}' AS VARBINARY(MAX)), 'TestVisualCronZIP.zip', 'application/zip', 1
FROM Asset
WHERE AssetId NOT IN(SELECT AssetId FROM AttachmentValue WHERE AttributeId = 'rptTEMADeduct')
AND AssetTypeId = 'PAY'

Step 1 runs fine, step 2 returns a bunch of "Incorrect syntax" errors.

Am I approaching this correctly, or would someone recommend a different method?

As a side note, instead of using a SQL task, I changed it to a write file, so I was trying to write the standard output from previous task (step 1). That ran fine, but the data in the output file was not right, seems like it had issues reading the special characters.

Thanks!
Sponsor
Forum information
ErikC
2011-01-31T08:15:52Z
Have you tried running your SQL query in the management studio of SQL server?

Regards,
Erik
Uses Visualcron since 2006.
viper8
2011-01-31T15:12:33Z
Hi Erik,

Yeah, I ran it in management studio and the query is fine. The real issue seems to be that when the zip file is read into standard output of one task, it can't be read into another task properly. My guess is that VC has trouble properly handling the special characters in the zip file.
Support
2011-01-31T15:36:59Z
Quick note from our side. The standard out does not contain the actual zip but some kind of result from the Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
viper8
2011-01-31T18:07:26Z
Support wrote:

Quick note from our side. The standard out does not contain the actual zip but some kind of result from the Task.



Ahh okay, so is there any functionality in VisualCron that would allow a task to read a zip file? I thought I was on the right track with the Read task, and then using the standard output from that into another task, but I guess not. Do you recommend some other method?

One other question, if Read task isn't designed to be used for something similar, what is it designed for? It looks like by default you can only read the chosen file into Standard Output.

Thanks!
Support
2011-01-31T18:11:24Z
It is designed for reading text so it will try to read it as text. Perhaps you request a feature reading it as byte - because that is probably the input variable you expect in your sql query?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
viper8
2011-02-04T20:54:47Z
Support wrote:

It is designed for reading text so it will try to read it as text. Perhaps you request a feature reading it as byte - because that is probably the input variable you expect in your sql query?



Okay that's fine, we actually have a workaround in place now.

Thanks!
Scroll to Top