Oracle
1Z0-146 · Question #117
1Z0-146 Question #117: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-146 to reveal the answer and full explanation for question #117. The question stem and answer options stay visible for context.
Question
View the Exhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables. Examine the PL/SQL block that you execute to find the average salary for employees in the 'Sales' department: DECLARE TYPE emp_sal IS TABLE OF employees.salary%TYPE INDEX BY VARCHAR2(20); v_emp_sal emp_sal; PROCEDURE get_sal(p_dept_name VARCHAR2, p_arr OUT emp_sal) IS BEGIN SELECT AVG(salary) INTO p_arr(p_dept_name) FROM employees WHERE department_id= (SELECT department_id FROM departments WHERE department_name=p_dept_name); END get_sal; BEGIN get_sal('Sales',v_emp_sal); DBMS_OUTPUT.PUT_LINE( v_emp_sal('Sales')); END; / What is the outcome?
Exhibit
Options
- AIt executes successfully and gives the correct output.
- BIt generates an error because the associative array definition is not valid.
- CIt generates an error because an associative array cannot be passed to a procedure in OUT mode.
- DIt generates an error because an associative array cannot be used with the SELECT INTO statement.
Unlock 1Z0-146 to see the answer
You've previewed enough free 1Z0-146 questions. Unlock 1Z0-146 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
