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:

When Posting, if there is a long code, can choose the format into the source code, are more likely to see,

CodePudding user response:

Dw_master nor dw_detail rollback?

CodePudding user response:

Sqlca. The autocommit=false there is nothing wrong with that, after the rollback dw_master \ dw_detail is not to save the data in the database this is correct, but the update inventory update statement execution failed to rollback, thanks for the reply above. Problem is not solved.

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:

reference 4 floor zwk888 response:
sqlca. The autocommit=false there is nothing wrong with that, after the rollback dw_master \ dw_detail is not to save the data in the database this is correct, but update the stock update statement execution failed to rollback, thanks for the reply above. Problem is not solved.


This means that the call to dw. The update () before, there must be carried out the 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.

=1 why rolled back, the original poster a few pieces are very strange

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

If the sqlca. Sqlnrows=0 then

CodePudding user response:

The debug line by line, it comes to database operations to check the sqlca sqlcode attribute values, you can find the specific is where one line of code that are submitted out

CodePudding user response:

Try to join a dw_detail. Accepttext (), can you did not receive the update data is the data window??

CodePudding user response:

Not a single transaction

CodePudding user response:

Pb debug and SQL server profile used at the same time