RelationalDBDesignRelationalDBDesign 


Web Applications   «Prev 

Date-time stamp

When issuing any update SQL, all applications are required to select the date-time stamp column and include it in the WHERE clause.If the row has not changed, the update will be successful.
1) When issuing any update SQL, all applications are required to select the date-time stamp column and include it in the WHERE clause.If the row has not changed, the update will be successful.

In our example, we assume that a column called date_last_updated has been added to the employee table.
2) In our example, we assume that a column called date_last_updated has been added to the employee table.

We need only check the value of this column when we retrieved it, with the existing value.
3) We need only check the value of this column when we retrieved it, with the existing value.

Of course, since the row has changed, the date-time stamps will not match, and the transaction will fail with a not found SQL code.
4) Of course, since the row has changed, the date-time stamps will not match, and the transaction will fail with a not found SQL code.