Project

General

Profile

7496a-minimal-fixed.p

Dănuț Filimon, 01/30/2024 04:52 AM

Download (838 Bytes)

 
1
define variable vhIQuery as handle no-undo.
2
define variable vhIBuffer as handle no-undo.
3

    
4
create buffer vhIBuffer for table "pt1":U.
5
create query vhIQuery.
6
vhIQuery:add-buffer(vhIBuffer).
7
vhIQuery:forward-only = true.
8
vhIQuery:query-prepare("for each pt1").
9
vhIQuery:query-open().
10

    
11
do transaction:
12
    vhIQuery:get-first(exclusive-lock).
13

    
14
    if not vhIBuffer:available then do:
15
        vhIBuffer:buffer-create().
16
        assign vhIBuffer::f1 = 1
17
               vhIBuffer::f2 = 2.
18
        message "created record 1".
19
    end.
20
           
21
    if not vhIQuery:query-off-end then do:
22
        vhIQuery:get-next(exclusive-lock).
23
        message "get-next".
24
    end.
25
           
26
    if vhIQuery:query-off-end then do:
27
        message "query should be off-end".
28
    end.
29
end.
30

    
31
for each pt1.
32
    delete pt1.
33
end.