Home > database >  After the rollback data don't rolled back, wondering...
After the rollback data don't rolled back, wondering...

Time:09-25

For ll_rowno=dw_detail. Rowcount () to step 1-1
Dwstatus=dw_detail. Getitemstatus (ll_rowno, 0, primary!
Ls_wlbm=dw_detail. Getitemstring (ll_rowno, "WLBM")
Ls_wlname=dw_detail. Getitemstring (ll_rowno, "wlname")
If ls_wlbm='or isnull (ls_wlbm) or ls_wlname=' or isnull (ls_wlname) then
Dw_detail. Deleterow (ll_rowno)
The continue
End the if

Select count (*) into: li_count from wlk_bm where WLBM=: ls_wlbm;

If li_count=0 then
Messagebox (mt, "& lt; Material code & gt; No this code: "+ ls_wlbm +", please check it. "that stopsign! , ok!
The rollback.
Ii_result=1
Return
End the if


.//ldec_oldqty [ll_rowno]=dw_detail getitemdecimal (ll_rowno, "wlqty", primary! Before, true)//modify
Ldec_newqty [ll_rowno]=dw_detail. Getitemdecimal (ll_rowno, "wlqty", primary! , false)//modified
Choose a case dwstatus
The case of new! , notmodified!
The continue
Case newmodified!
Dw_master. Iuv_linkage. Uf_set_pkey (ll_rowno)

The update wlk_acc_bill set instock=instock + : ldec_newqty [ll_rowno], modifydate=getdate () where WLBM=: ls_wlbm and wlpostion=: gs_depotno;
If the sqlca. Sqlnrows=0 then
The rollback.
Messagebox (mt, update the stock failed! "" )
Ii_result=1
The return - 1
Case datamodified!
////
The end choose
Next
End the if


//
/* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - */
IF dw_master. Update (true, false)=1 then
If dw_detail. The update ()=1 THEN
- test here, after the rollback, the update data or update, didn't roll back?

The rollback.//test

If the SQLCA. The AutoCommit=False then
Messagebox (mt), "false")
The else
Messagebox (mt), "true")
End if//prompts the sqlca. The autocommit=false

//Commit;
Dw_master. Resetupdate ()
//dw_detail resetupdate ()
Open (w_success)
Ii_result=1

Wf_set_button_e (" AEDP23X ")
Enclosing triggerevent (" ue_closeedit ")
Ii_recorder_status=0
RETURN 1
The ELSE
The Rollback.
MessageBox (" ", "save data failed!" + the sqlca. Sqlerrtext)
Ii_result=1
The RETURN - 1
END the IF
The else
The Rollback.
MessageBox (" ", "save data failed!" + the sqlca. Sqlerrtext)
Ii_result=1
The RETURN - 1
END the IF

-- -- --
Please help me find problem. Thank you so much!

CodePudding user response:

Have a look at the sqlca. The AutoCommit mode is set to true the

In the first row set the sqlca. The autocommit=false, and then try again

CodePudding user response:

What is your uf_set_pkey function? There should be other places were presented;
Using SQL trace analyzer tracking, see the update statement whether commit or between the rollback DDL or DCL SQL operations;

CodePudding user response:

Before call dw. The update (), must have to perform a commit, look at the data window updatestart event ever commit, or complete a breakpoint tracing debugged, look after the update statement, dw. If there is a commit statement before the update () is executed

CodePudding user response:

Returns 1 if it succeeds and 1 if an error occurs. If any argument 's value is NULL, the Update Returns NULL. If there is no DataWindow object assigned to the DataWindow control or DataStore, this method Returns 1.

What is=1 roll back