At 01:27 AM 1/23/2016, Bruce Chitiea wrote:
Can anyone recommend a syntax for loading an [ .EML | .TXT | .PDF |
.WPD | .Whatever ]
file into an RBASE XE BSTR column?
Bruce,
Technically, BSTR holds binary string data and supports Unicode in
the table data.
Having explained that, if you wish to store external files, such as
.EML, .TXT,
.PDF, .WPD, .DOC, etc., I suggest to use VARBIT data type to
accomplish your goal.
Once re-defined, use the following example to understand the concept
of storing
external files in table.
-- Example
SET VAR vQuote TEXT = (CVAL('QUOTES'))
SET VAR vExternalFileName TEXT = 'filename.pdf'
SET VAR vFileNameToLoad TEXT = ('['+.vQuote+.vExternalFileName+.vQuote+']')
UPDATE tablename SET VARBITcolname = &vFileNameToLoad WHERE whereclause
RETURN
Notice the use of '[', ']', and the file name surrounded by quotes.
Once loaded successfully, you will need to create a routine that will identify
the file name with correct extension, and then use the WRITE command to unload
the file to disk. Then, use the LAUNCH command to open/view the file
accordingly.
Hope that helps!
Very Best R:egards,
Razzak.