how can i create in a table a column with an integer value (starting by 0 when i insert a row) that will be incremented by 1 every time i update a row ?
I need it to use it as optimistic locking.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need to use a trigger to achieve this.
There is no automatic or built-in solution for this
Note that the trigger function can be used for any table that contains a column named
version(that is a number).