![]() | ![]() | 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 ofsm_tm_inquireTM_OCCand 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 of 1 andTM_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
SELECTtransaction command callssm_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_MODEandsm_bi_initializewas successful. Notice that the models setTM_OCC_COUNTto -1 before callingsm_bi_copy. This ensures that all onscreen occurrences are copied.
![]()
![]()
![]()
![]()