nerdexam
Oracle

1Z0-146 · Question #48

View the Exhibit and examine the structure of the EMPLOYEES table. Examine the following PL/SQL block: DECLARE TYPE EmpList IS VARRAY(2) OF employees.employee_id%TYPE NOT NULL; v_employees EmpList…

The correct answer is B. It executes successfully and displays the value 0. Oracle Database PL/SQL Language Reference 11g Release 1 (11.1) Counting the Elements in a Collection (COUNT Method) "For varrays, COUNT always equals LAST. You can increase or decrease the size of a varray using the EXTEND and TRIM methods, so the value of COUNT can change, up…

Advanced PL/SQL Features

Question

View the Exhibit and examine the structure of the EMPLOYEES table. Examine the following PL/SQL block:

DECLARE TYPE EmpList IS VARRAY(2) OF employees.employee_id%TYPE NOT NULL; v_employees EmpList := EmpList(); BEGIN DBMS_OUTPUT.PUT_LINE(v_employees.COUNT); v_employees.EXTEND; v_employees(1) := 30; END; / Which statement is true about the outcome on executing the above PL/SQL block?

Exhibit

1Z0-146 question #48 exhibit

Options

  • AIt executes successfully and displays the value 2.
  • BIt executes successfully and displays the value 0.
  • CIt generates an error because EXTEND cannot be used for varrays.
  • DIt generates an error because the declaration of the varray is not valid.

How the community answered

(50 responses)
  • A
    2% (1)
  • B
    84% (42)
  • C
    10% (5)
  • D
    4% (2)

Explanation

Oracle Database PL/SQL Language Reference 11g Release 1 (11.1) Counting the Elements in a Collection (COUNT Method) "For varrays, COUNT always equals LAST. You can increase or decrease the size of a varray using the EXTEND and TRIM methods, so the value of COUNT can change, up to the value of the LIMIT method.

Topics

#VARRAY#collection methods#EXTEND#NOT NULL element type

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice