Select for update, nowait, skip locked

FOR UPDATE NOWAIT

BEGIN
SELECT x FROM table FOR UPDATE NOWAIT;
EXCEPTION
WHEN OTHERS THEN
<handle exception>
END;

FOR UPDATE(Wait model)
BEGIN
SELECT x FROM table FOR UPDATE;
EXCEPTION
WHEN OTHERS THEN
<handle exception>
END;

Select for update, nowait, skip locked


你可能感兴趣的:(update,for)