Difference between revisions of "CHANGE()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 30: Line 30:
 
if not change()
 
if not change()
 
     replace customer.name with m.name,;
 
     replace customer.name with m.name,;
    customer.address with m.address,;
+
      customer.address with m.address,;
    customer.state with m.state
+
      customer.state with m.state
 
endif
 
endif
 
</code>
 
</code>
Line 40: Line 40:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Manual Locking]]
 +
[[Category:Manual Locking Functions]]

Revision as of 08:52, 2 June 2009

Class

Manual Locking


Purpose

Determine whether a record has been updated since it was last read


Syntax

CHANGE()


See Also

GATHER, READ, REPLACE , SET LOCKTYPE


Description

The CHANGE() function can be used in conjunction with SET LOCKTYPE TO OPTIMISTIC to determine whether a record has been updated since it was last read. If the records has been updated by another process since it was last read, the CHANGE() function will return .T. (TRUE), otherwise it will return .F. (FALSE).


Example

set locktype to optimistic
use customer
store automem
@1,1 get m.name
@2,1 get m.address
@3,1 get m.state
read
if not change()
    replace customer.name with m.name,;
      customer.address with m.address,;
      customer.state with m.state
endif


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer