Dear Rao Sir,
May I request to share the example of Maria DB Rowset Batch Operation in which record add / Modify / Delete and finally save the data in batch mode. Thanks in advance..!
Thanks
Shridhar
Dear Rao Sir,
May I request to share the example of Maria DB Rowset Batch Operation in which record add / Modify / Delete and finally save the data in batch mode. Thanks in advance..!
Thanks
Shridhar
oRs := oCn:RowSet( cSql )
oRs:SetBatchMode( .t. )
XBROWSER oRs FASTEDIT
if oRs:IsBatchEdited()
if MsgYesNo( "Save Changes?" )
oRs:SaveBatch()
else
oRs:CancelBatch()
endif
endif
XBROWSER oRsDear Rao Sir ,
Will try and update you. Many thanks...!!
Thanks
Shridhar
Mr Rao,
What is the differenc between BATCH and TRANSACTION ? Could you explain it to me ?
aSql := { "UPDATE table1 ... WHERE ... ", ;
"UPDATE table2 ... WHERE ... ", ;
..more.., ;
}
if WriteAllOrNone( oCn, aSql )
? "Written"
else
? "fail"
endif
//-------------------------------
function WriteAllOrNone( oCn, aSql )
local cUpdateSql
oCn:BeginTransaction()
for each cUpdateSql IN aSql
oCn:Execute( cSql )
if oCn:nError != 0
oCn:RollBack()
return .f.
endif
next
oCn:CommmitTransaction()
return .t.oRs := oCn:RowSet( cSql )
oRs:SetBatchMode( .t. )oCn:SaveBatch() // write all changes
oCn:CancelBatch() // discard all changesDear Rao Sir ,
As requested , could you please provide code to use extended the feature of XBROWSE , DATAROW & ROWSET.
Thanks
Shridhar
BEGIN SEQUENC
oCn:BeginTransaction()
oCn:Insert(...)
oCn:Insert(...)
oCn:Insert(...)
oCn:CommitTransaction()
RECOVER USING oError
oCn:RollBack()
END SEQUENC