What would be the outcome when the code is executed?

View Exhibit1 and examine the structure of the employees table.


View Exhibit2 and examine the code.


What would be the outcome when the code is executed?
A. It executes successfully.
B. It gives an error because the SAL variable is not visible in the increase function.
C. It gives an error because the increase function cannot be called from the RAISE_SALARY procedure.
D. It gives an error because the increase function and the RAISE_SALARY procedure should be declared at the beginning of the declare section before all the other declarations.

Download Printable PDF. VALID exam to help you PASS.

One thought on “What would be the outcome when the code is executed?

  1. Agree that correct answer is A.
    Code executed successfully for me in HR demo schema.

    declare
    emp_num number(6):=120;
    sal number;
    function increase (emp_num number) return number is
    inc_amt number;
    begin
    select salary into sal from employees where employee_id=emp_num;
    inc_amt:=sal*.10;
    return inc_amt;
    end;

    procedure raise_salary (emp_id number) is
    amt number;
    begin
    amt:=increase(emp_num);
    update employees set salary=salary+amt
    where employee_id=emp_id;
    end raise_salary;
    begin
    raise_salary(emp_num);
    commit;
    end;
    /

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.