-- Listing 7-21. PL/SQL Code for the FetchRecordForUpdate Process
declare
    v_valuesToHash apex_t_varchar2;
begin
    -- First, fetch the employee record and save its values.
    select EName, Job, Sal, DeptNo
    into :P20_UPDATE_ENAME, 
         :P20_UPDATE_JOB, 
         :P20_UPDATE_SALARY, 
         :P20_UPDATE_DEPTNO
    from EMP
    where EmpNo = :P20_EMPNO;

    -- Then save the hash of the updatable values.
    v_valuesToHash := apex_t_varchar2(:P20_UPDATE_JOB, :P20_UPDATE_SALARY,
                                      :P20_UPDATE_DEPTNO);  
    :P20_HASH := apex_util.get_hash(v_valuesToHash); 
end;

