I'm trying to create a stored procedure to grab a record from a table and update the record.
But, I fear this will allow anyone to run over the procedure and get the same COL2 value before I update the record. I hear using "lock table in exclusive mode" would be a bad thing to do. What can I do?
Code:
declare val integer; select COL2 into val from TAB1 where COL1 = 777; update TAB1 set COL2 = COL2 + 1;
Comment