609
社区成员
发帖
与我相关
我的任务
分享
PowerBuilder These statements coordinate the update of two DataWindow objects:
int rtncode
CONNECT USING SQLCA;
dw_cust.SetTransObject(SQLCA)
dw_sales.SetTransObject(SQLCA)
rtncode = dw_cust.Update(TRUE, FALSE)
IF rtncode = 1 THEN
rtncode = dw_sales.Update(TRUE, FALSE)
IF rtncode = 1 THEN
dw_cust.ResetUpdate() // Both updates are OK
dw_sales.ResetUpdate()// Clear update flags
COMMIT USING SQLCA; // Commit them
ELSE
ROLLBACK USING SQLCA; // 2nd update failed
END IF
END IF