Merge one record to another

 1 static void LedgerReasonMerge(Args _args)
 2 {
 3   ReasonTable reasonTableDelete;
 4   ReasonTable reasonTable;
 5   ;
 6 
 7   ttsBegin;
 8   select firstOnly forUpdate reasonTableDelete
 9     where reasonTableDelete.Reason == 'COUNTER';
10   select firstOnly forUpdate reasonTable
11     where reasonTable.Reason == 'AUCTION';
12   reasonTableDelete.merge(reasonTable);        //merge table record
13   reasonTable.doUpdate();
14   reasonTableDelete.doDelete();
15   ttsCommit;
16 }
posted @ 2012-08-28 09:11  Sprite.z  Views(152)  Comments(0Edit  收藏  举报