Whenever a physical table is created and maintained by LANSA, rather than some OTHER system, it has an additional column placed into it.
The column is called @@UPID and is defined as decimal (7,0). It is always the last column in the table.
Column @@UPID is used by LANSA to automatically check for "crossed updates". The logic to do this is very simple:
- Read the record and save the @@UPID value.
- If an update is required: re-read the record and compare the @@UPID with the saved @@UPID value. If different, issue a "crossed update" error message, else add 1 to @@UPID and update the table record.
When writing user application programs in non-LANSA applications, to write new records or update existing records in database tables created by LANSA the following is recommended:
- Set @@UPID to 1 when writing new records.
- Add 1 to @@UPID when updating an existing record.
This effectively emulates the logic automatically used in all LANSA functions.
Note
Warning
Note
Also See
RESET_@@UPID Built-In Function.