temp-table-handle :attribute :method
|
–
|
DEFINE VARIABLE tth AS HANDLE NO-UNDO.
DEFINE VARIABLE bh AS HANDLE NO-UNDO. DEFINE VARIABLE qh AS HANDLE NO-UNDO. DEFINE VARIABLE buf-cust-handle AS HANDLE NO-UNDO. /* Get db table handle as usual */ buf-cust-handle = BUFFER Customer:HANDLE. /* Create an "empty" undefined temp-table */ CREATE TEMP-TABLE tth. /* Give it Customer's fields and indexes */ tth:CREATE-LIKE(buf-cust-handle). /* Give it a single extra field */ tth:ADD-NEW-FIELD("f1","integer"). /* No more fields or indexes will be added to custx */ tth:TEMP-TABLE-PREPARE("custx"). /* Get the buffer handle for the temp-table */ bh = tth:DEFAULT-BUFFER-HANDLE. /* Populate the table from Customer table */ FOR EACH Customer NO-LOCK: bh:BUFFER-CREATE. bh:BUFFER-COPY(buf-cust-handle). END. /* Run a query to access it*/ CREATE QUERY qh. qh:SET-BUFFERS(bh). qh:QUERY-PREPARE("FOR EACH custx WHERE . . ."). . . . |