Hi
I have below stored procedure to get last max value. How to ensure that at same time 2 Users does not get same value , though it is Primary Key.
CREATE PROCEDURE GetMaxValue(IN tableName VARCHAR(255), IN columnName VARCHAR(255)) BEGIN SET @query = CONCAT('SELECT MAX(', columnName, ') AS max_value FROM ', tableName); PREPARE stmt FROM @query; EXECUTE stmt; DEALLOCATE PREPARE stmt; END SQL
Thanks