Project

General

Profile

table-blob.p

Alexandru Donica, 09/26/2023 08:52 AM

Download (869 Bytes)

 
1
define temp-table tt no-undo 
2
    field fd1 as integer
3
    field fd2 as char
4
    field lob as blob.
5

    
6
define variable cLongChar as longchar no-undo.  
7

    
8
create tt.
9
assign tt.fd1 = 1
10
       tt.fd2 = "With blob"
11
       cLongChar = 'test blob':U.
12
       copy-lob cLongChar to tt.lob
13
       no-convert no-error.  
14
       
15
define variable cTempPath as character no-undo.
16
assign cTempPath = session:temp-directory
17
       cTempPath = cTempPath + "export/".
18

    
19
file-info:file-name = cTempPath.
20
os-create-dir value (cTempPath).
21

    
22
cTempPath = cTempPath + "blob/".
23
os-delete value(cTempPath) RECURSIVE.       
24
file-info:file-name = cTempPath.
25
os-create-dir value (cTempPath).
26

    
27
define stream sdata.
28
output stream sdata to value(cTempPath + "tt.d":U) no-map no-convert.
29
for each tt:        
30
     export stream sdata tt.     
31
end.
32
output stream sdata close.