How to Extract a long string (LZH compressed) as save it as a file
Hello!
I would like to extract long data from a SQL source database:
- one column contains the file name
- a second one (string with length 2147483647) shoud be the contain of original file attached then compressed with LZH.
First, is there any component which allows to create a file based of a column value? If yes, which one?
Secondy, how can we uncompress the string before saving the file?
Any suggestions, please?
Thanks.
what do you mean by component which allow to create a file based on a column value?
like this
myfile=
a
b
c
d
e
"Secondy, how can we uncompress the string before saving the file?" do you want to uncompressed the file?
IN system, the attachments are not stored in a vault (with a reference in a table) but stored as a hudge string. This string is the result of the compression with method LZH of the contains of original filer.
Example of Table:
Key FileName Data
id1 doc1.doc AREATET76416161561541ZTYZRTYZRYTZR....
id2 doc2.doc AREATET65765761561541ZTYZRTYZRYTZR....
So, i would like to rebuild each file by making the reverse job: for each record, uncompress the string Data and save the result in a file FileName.
Is it better?
I'm not sure but I think I've understand your problem.
You want to create some file doc1.doc, doc2.doc wich are the result of the uncompression of data.row1, data.row2 etc...
so You want to create temp files with the value of data.row1, data.row2
Am I right?
I can't test it here. But have you tried to write your data with a tFileOutputXXX? I would say this is the only solution for your problem. But you may run into problems with encoding...