![]() | Programming Guide | ![]() |
Copies current values of a range of occurrences to before images
#include <tmusubs.h>int sm_bi_copy(void);
sm_bi_copywrites 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_COUNThas a value of-1,sm_bi_copygets the number of occurrences in the table view. IfTM_OCChas a value of1andTM_OCC_COUNThas-1,sm_bi_copycopies every occurrence in the table view. Use sm_tm_iset to set the values ofTM_OCCandTM_OCC_COUNTbefore callingsm_bi_copy.The SELECT transaction command calls
sm_bi_copyfor updatable and non-updatable table views. It setsTM_OCCto the first occurrence where data was fetched; it setsTM_OCC_COUNTto the number of rows fetched. Therefore,sm_bi_copycopies each selected occurrence.The standard transaction models call
sm_bi_copyin theTM_POST_SAVErequest if the current mode isTM_UPDATE_MODEand sm_bi_initialize was successful. Notice that the models setTM_OCC_COUNTto-1before callingsm_bi_copy. This ensures that all onscreen occurrences are copied.
![]()
![]()
![]()
![]()