-- Listing 8-3. Validation Code for Detecting a Lost Update
declare
      v_valuesToHash apex_t_varchar2;
begin
      -- first re-read the data
      select apex_t_varchar2(Job, Sal, DeptNo)
      into v_valuesToHash
      from EMP
      where EmpNo = :P17_UPDATE_EMPNO;

      -- then compare it with the original data
      if :P17_HASH = apex_util.get_hash(v_valuesToHash) then
            return TRUE;
      else
            return FALSE;
      end if;
end;

