Oracle
1Z0-146 · Question #114
View the Exhibit and examine the structure of the EMPLOYEES table. Examine the following PL/SQL block for storing the salary of all sales representatives from the EMPLOYEES table in an associative…
The correct answer is A. Replace EMP_CV in line 3 with employees.salary%TYPE. See the full explanation below for the reasoning.
Question
View the Exhibit and examine the structure of the EMPLOYEES table. Examine the following PL/SQL block for storing the salary of all sales representatives from the EMPLOYEES table in an associative array:
1 DECLARE 2 emp_cv SYS_REFCURSOR; 3 TYPE list IS TABLE OF emp_cv; 4 sals list; 5 BEGIN 6 OPEN emp_cv FOR SELECT salary FROM employees 7 WHERE job_id = 'SA_REP'; 8 FETCH emp_cv BULK COLLECT INTO sals; 9 CLOSE emp_cv; 10 END; What should you correct in the above code to ensure that it executes successfully?
Exhibit
Options
- AReplace EMP_CV in line 3 with employees.salary%TYPE.
- BReplace line 2 with TYPE refcur IS REF CURSOR; emp_cv refcur;.
- CReplace BULK COLLECT in line 8 with the OPEN, FETCH, LOOP, and CLOSE statements.
- DReplace line 2 with TYPE refcur IS REF CURSOR RETURN employees.salary%TYPE; emp_cv refcur;.
How the community answered
(38 responses)- A76% (29)
- B5% (2)
- C11% (4)
- D8% (3)
Community Discussion
No community discussion yet for this question.
