Is it possible from within a stored procedure to zip up files ? asked 14 Feb '13, 18:06 spc Volker Barth |
[edit 2013-02-15] Sorry, most of my response above is bogus... I confused compression with encryption :-( Since SA v10 the compress() and decompress() functions have had a second parameter named 'algorithm' which when set to 'gzip' can be used to compress/decompress data that can be exchanged outside of the database server and decompressed/compressed using gunzip/gzip. Example: -- write compressed contents of variable @data to file data.gz call xp_write_file( 'data.gz', compress( @data, 'gzip' ) ); -- and then decompress it using gunzip call xp_cmdshell( 'gunzip data.gz' ); answered 14 Feb '13, 21:00 Mark Culp 2
It's the tie you're wearing in your photo... restricts the bloodflow :)
(15 Feb '13, 15:25)
Breck Carter
|
What about reading the file with xp_read_file() and using the builtin COMPRESS() function to compress data and write it back to file with xp_write_file()? Note, I can't tell whether the builtin compression with the "zip" algorithm will be compatible with ordinary zipped files. On Linux, using "gzip" should work that way. - Mark's response may indicate that "zip" itself won't work here as expected... answered 15 Feb '13, 03:54 Volker Barth
[Edit: 2013-02-15 this statement is incorrect - I have corrected my answer to this question] Also, the question was not clear whether a single file was being zipped or a zip archive (containing multiple files) was wanted.
(15 Feb '13, 07:26)
Mark Culp
Replies hidden
Thanks for the clarification - I had a weak impression I had read about that limitation in some FAQ or NNTP thread (therefore my suspicion...) but couldn't find anything relevant. Now it's well-documented here, at least:)
(15 Feb '13, 08:12)
Volker Barth
Hmmm, have I overseen something in the Nagano docs...?
(15 Feb '13, 08:35)
Volker Barth
Hmm, I'm not so sure anymore:)
(16 Feb '13, 05:22)
Volker Barth
Okay, when Mark has been refering to encryption instead of compression, then the v16 hint makes sense ("Raw encryption", do you hear me?)...
(16 Feb '13, 05:23)
Volker Barth
|
I ended up downloading 7-Zip, writing a bat file to call 7 Zip, and then calling that bat file with an Event. Worked well. answered 17 Jun '13, 14:01 spc |