project BLF > class Persistence (other) > method ReadData

Description

General procedure to read data from the database into the class dataset.
The data is stored into the temp-tables referred by a handle in tFcDynRel.


Parameters


tDynRelinputtemp-tableDescription of the data to read.
ihClassinputhandleHandle to the class that is using the persistence layer. In most of the cases, this handle will be available in the preprocessor {&TARGETPROCEDURE}.
oiReturnStatusoutputinteger


Internal usage


unused


program code (program1/other.p)

/* Clean up the garbage */
for each tBufferFields where
         not valid-handle(tBufferFields.thTempBuffer):
    delete tBufferFields.
end.

for each tDynRel where
         tDynRel.tcFcFrom = "":

    <M-1 run ReadDataRecursive (input  tDynRel.tcFcTo (icTableName), 
                            input  tDynRel.thFcBuffer (ihDestinationBuffer), 
                            input  tDynRel.thFcIBuffer (ihIDestinationBuffer), 
                            input  tDynRel.tcFcRel (icPrepare), 
                            input  '' (icParentRowid), 
                            input  true (ilTopLevel), 
                            input  ihClass (ihClass), 
                            output oiReturnStatus (oiReturnStatus)) in other>

    empty temp-table tRowidList.
    
    if oiReturnStatus <> 0 then return.
end.

if can-find (first tDynRel where tDynRel.tcParent <> "")
then do:
    <M-2 run UpdateParent (output oiReturnStatus (oiReturnStatus)) in other>
end.