Project

General

Profile

temp-table.p

Test program #2 - Igor Skornyakov, 10/02/2022 12:17 PM

Download (2.32 KB)

 
1
DEFINE TEMP-TABLE tt NO-UNDO
2
    NAMESPACE-URI "http://goldencode.com/testNamespace" 
3
    NAMESPACE-PREFIX "fwdPrefix"  
4
    FIELD achar  as char format "XXXX" initial '99aa' label "char-attr" xml-node-name 'pk' // xml-node-type 'attribute' 
5
    FIELD aint as int format "99999" initial 1 label "int-attr" xml-data-type 'long' xml-node-type 'attribute'
6
    FIELD fchar  as char format "XXXX" initial '99aa' label "char" 
7
    FIELD fcharcs  as char bgcolor 12 dcolor 9 fgcolor 14 pfcolor 16 font 1 mouse-pointer 'cross' format "XXXX" initial 'aa88' case-sensitive label "char-cs" 
8
    FIELD fcharext  as char extent 8 case-sensitive label "char-ext" 
9
    FIELD fdecimal as decimal format "->>,>>9.99" decimals 2 label "decimal"
10
    FIELD fint as int bgcolor 12 dcolor 9 fgcolor 14 pfcolor 16 font 1 mouse-pointer 'cross' format "99999" initial 1 label "int" 
11
    FIELD fint64 as int64 format "99999" initial 4 label "int64"
12
    FIELD fbool as logical initial true label "bool"
13
    FIELD fdate as date initial today label "date"
14
    FIELD fdatetime as datetime initial now  label "datetime"
15
    FIELD fdatetime-tz as datetime-tz initial now label "datetime-tz"
16
    FIELD fblob as blob label "blob" column-label "blob-column"
17
    FIELD fclob1 as clob label "clob1" TTCODEPAGE xml-node-type 'hidden'
18
    FIELD fclob2 as clob label "clob2" COLUMN-CODEPAGE 'ibm850' 
19
    FIELD frecid as recid label "recid"
20
    FIELD fhandle as handle label "handle"
21
    FIELD fcom-handle as com-handle label "com-handle"
22
    FIELD fraw as raw
23
    FIELD frowid as rowid
24
    index idx1 fchar
25
.
26

    
27
DEF VAR htt AS HANDLE NO-UNDO.
28
DEF VAR lRet AS LOGICAL NO-UNDO.
29

    
30
create tt. tt.fchar = '1111'. 
31
create tt. tt.fchar = '2222'. 
32

    
33
TEMP-TABLE tt:WRITE-XMLSCHEMA('file', 'xml-test/tt.xsd', true,  'UTF-8', false, false).
34

    
35
TEMP-TABLE tt:WRITE-XML('file', 'xml-test/tt.xml', true,  'UTF-8', 'xml-test/tt.xsd', false, false, ?, false).
36

    
37
CREATE TEMP-TABLE htt.
38

    
39
lRet = htt:READ-XMLSCHEMA('file', 'xml-test/tt.xsd', false, ?, ?).
40

    
41
MESSAGE 'READ-XMLSCHEMA' lRet.
42

    
43
htt:WRITE-XMLSCHEMA('file', 'xml-test/htt.xsd', true,  'UTF-8', false, false).
44

    
45
lRet = htt:READ-XML('file', 'xml-test/tt.xml', 'empty', 'xml-test/htt.xsd', ?, ?, ?).
46

    
47
MESSAGE 'READ-XML' lRet.
48

    
49
htt:WRITE-XML('file', 'xml-test/htt.xml', true,  'UTF-8', 'xml-test/htt.xsd', false, false, ?, false).
50