Programming Guide |
Copies current values of a range of occurrences to before images
#include <tmusubs.h>int sm_bi_copy(void);
sm_bi_copy
writes the current values of a range of occurrences to their respective before-image occurrences. The starting occurrence is the value of sm_tm_inquire("TM_OCC
") and the range of occurrences is determined by the value ofsm_tm_inquire("TM_OCC_COUNT")
. IfTM_OCC_COUNT
has a value of-1
,sm_bi_copy
gets the number of occurrences in the table view. IfTM_OCC
has a value of1
andTM_OCC_COUNT
has-1
,sm_bi_copy
copies every occurrence in the table view. Use sm_tm_iset to set the values ofTM_OCC
andTM_OCC_COUNT
before callingsm_bi_copy
.The SELECT transaction command calls
sm_bi_copy
for updatable and non-updatable table views. It setsTM_OCC
to the first occurrence where data was fetched; it setsTM_OCC_COUNT
to the number of rows fetched. Therefore,sm_bi_copy
copies each selected occurrence.The standard transaction models call
sm_bi_copy
in theTM_POST_SAVE
request if the current mode isTM_UPDATE_MODE
and sm_bi_initialize was successful. Notice that the models setTM_OCC_COUNT
to-1
before callingsm_bi_copy
. This ensures that all onscreen occurrences are copied.