在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1、SQL实现增删改 try if not DTM.Conn.InTransaction then DTM.Conn.StartTransaction; //插入制式机型 Init; A('insert into scd2_det2(scd22_flow, scd22_fmt, scd22_price_up, scd22_rmks, scd22_crt_by, scd22_crt_date, scd22_mod_times, scd22_mod_by, scd22_mod_date, '); A(' scd22_char1, scd22_char2, scd22_char3, scd22_char4, scd22_char5, scd22_char6, scd22_qty1, scd22_qty2) '); A('select :sc2_flow, scd22_fmt, scd22_price_up, scd22_rmks, :curr_user, sysdate, 0, :curr_user, sysdate, '); A(' scd22_char1, scd22_char2, scd22_char3, scd22_char4, scd22_char5, scd22_char6, scd22_qty1, scd22_qty2 '); A('from scd2_det2 '); A('where scd22_flow = :org_sc2_flow '); P('sc2_flow').Value := sc2_mstr.F('sc2_flow').Value; P('org_sc2_flow').Value := sc2_flow; P('curr_user').Value := g_UserInfo.UserID; ExecSQL; //插入明细机型 Init; A('insert into scd2_det(scd2_flow, scd2_mt, scd2_price_down, scd2_rmks, scd2_crt_by, scd2_crt_date, scd2_mod_times, scd2_mod_by, scd2_mod_date, '); A(' scd2_char1, scd2_char2, scd2_char3, scd2_char4, scd2_char5, scd2_char6, scd2_qty1, scd2_qty2, SCD2_BASE) '); A('select :sc2_flow, scd2_mt, scd2_price_down, scd2_rmks, :curr_user, sysdate, 0, :curr_user, sysdate, '); A(' scd2_char1, scd2_char2, scd2_char3, scd2_char4, scd2_char5, scd2_char6, scd2_qty1, scd2_qty2, SCD2_BASE '); A('from scd2_det '); A('where scd2_flow = :org_sc2_flow '); P('sc2_flow').Value := sc2_mstr.F('sc2_flow').Value; P('org_sc2_flow').Value := sc2_flow; P('curr_user').Value := g_UserInfo.UserID; ExecSQL; DTM.Conn.Commit; except if DTM.Conn.InTransaction then DTM.Conn.Rollback; Raise; abort; end; if PageMain.ActivePage=Page1 then begin scd2_det2.Close; scd2_det2.Open; scd2_det.Close; scd2_det.Open; end; with Query do begin init; A('update equ_mstr set equ_examin_date = trunc(:equ_examin_date,''DD''), '); A(' equ_next_date = trunc(:equ_examin_date,''DD'') + equ_interval where equ_part_id = :equ_part_id ') ; P('equ_part_id').AsString := equd_det.F('equd_part_id').AsString; P('equ_examin_date').Asdatetime := equd_det.F('equd_date').Asdatetime; try if not DTM.Conn.InTransaction then DTM.Conn.StartTransaction; ExecSQL; DTM.Conn.Commit; except if DTM.Conn.InTransaction then DTM.Conn.Rollback; Raise; end; end; equ_mstr.RefreshCurrent; end;
2、执行存储过程 with FSPUIQA4_qty do begin try if not DTM.Conn.InTransaction then DTM.Conn.StartTransaction; ExecProc; DTM.Conn.Commit; except if DTM.Conn.InTransaction then DTM.Conn.Rollback; Raise; abort; end; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论