Difference between revisions of "COMPLETED()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
(Example)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to determine whether an error occurred during a multi-statement transaction
 
Function to determine whether an error occurred during a multi-statement transaction
 
  
 
==Syntax==
 
==Syntax==
 
COMPLETED()
 
COMPLETED()
 
  
 
==See Also==
 
==See Also==
 
[[BEGIN TRANSACTION]], [[END TRANSACTION]], [[ISMARKED()]], [[RESET IN]], [[ROLLBACK]], [[ROLLBACK()]], [[SET ROLLBACK]]
 
[[BEGIN TRANSACTION]], [[END TRANSACTION]], [[ISMARKED()]], [[RESET IN]], [[ROLLBACK]], [[ROLLBACK()]], [[SET ROLLBACK]]
 
  
 
==Description==
 
==Description==
 
The COMPLETED() function returns .T. if no errors occurred during processing of any command issued between the BEGIN TRANSACTION and END TRANSACTION commands.
 
The COMPLETED() function returns .T. if no errors occurred during processing of any command issued between the BEGIN TRANSACTION and END TRANSACTION commands.
 
  
 
==Example==
 
==Example==
Line 36: Line 32:
 
end transaction
 
end transaction
 
if completed()
 
if completed()
     dialog box "Transaction completed OK
+
     dialog box "Transaction completed OK"
 
else
 
else
 
     dialog box "Errors occurred during transaction"
 
     dialog box "Errors occurred during transaction"
Line 42: Line 38:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Transaction Processing]]
 
[[Category:Transaction Processing]]
[[Category:Transaction Processing Functions]]
 

Latest revision as of 11:02, 23 May 2018

Purpose

Function to determine whether an error occurred during a multi-statement transaction

Syntax

COMPLETED()

See Also

BEGIN TRANSACTION, END TRANSACTION, ISMARKED(), RESET IN, ROLLBACK, ROLLBACK(), SET ROLLBACK

Description

The COMPLETED() function returns .T. if no errors occurred during processing of any command issued between the BEGIN TRANSACTION and END TRANSACTION commands.

Example

procedure recovery
  rollback
  if rollback()
      dialog box "Rollback was ok."
  else
      dialog box "Rollback failed."
  endif
return
 
use setcomm
on error do recovery
begin transaction
    reset in comm_2
    delete first 15
    insert
    replace all t1 with (t2*t3)/100
    list
end transaction
if completed()
    dialog box "Transaction completed OK"
else
    dialog box "Errors occurred during transaction"
endif