Which statement is true about the execution of the PL/SQL block?

View the Exhibit to examine the PL/SQL block.

Which statement is true about the execution of the PL/SQL block?

View the Exhibit to examine the PL/SQL block.

Which statement is true about the execution of the PL/SQL block?

A.
It executes successfully and gives the desired output.

B.
It does not execute because the definition of type population is indexed by VARCHAR2.

C.
It executes, and the string keys of an associative array are not stored in creation order, but in
sorted order.

D.
It does not execute because the value that is once assigned to the element of the associative
array cannot be changed.



Leave a Reply 15

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


Uladzimir

Uladzimir

C,
it is example from oracle documentation

alex

alex

I think this is a multi choice question. Answer is A and C.

Alisa

Alisa

A and C

=========================================================
DECLARE
TYPE salary IS TABLE OF NUMBER INDEX BY VARCHAR2(20);
salary_list salary;
name VARCHAR2(20);
BEGIN
— adding elements to the table
salary_list(‘Zzer’) := 100;
salary_list(‘Rajnish’) := 62000;
salary_list(‘Minakshi’) := 75000;
salary_list(‘Martin’) := 100000;
salary_list(‘James’) := 78000;

— printing the table
name := salary_list.FIRST;
WHILE name IS NOT null LOOP
dbms_output.put_line
(‘Salary of ‘ || name || ‘ is ‘ || TO_CHAR(salary_list(name)));
name := salary_list.NEXT(name);
END LOOP;
END;
/

SK

SK

AC correct and your code is corrected to use, you are wellcome

DECLARE
TYPE salary IS TABLE OF NUMBER INDEX BY VARCHAR2(20);
salary_list salary;
name VARCHAR2(20);
BEGIN
–adding elements to the table
salary_list(‘Zzer’) := 100;
salary_list(‘Rajnish’) := 62000;
salary_list(‘Minakshi’) := 75000;
salary_list(‘Martin’) := 100000;
salary_list(‘James’) := 78000;
— printing the table
name := salary_list.FIRST;
WHILE name IS NOT null LOOP
dbms_output.put_line (‘Salary of ‘ || name || ‘ is ‘ || TO_CHAR(salary_list(name)));
name := salary_list.NEXT(name);
END LOOP;
END;

Bruno

Bruno

The answer is AC.
You have to choose two answers.

Kaligula

Kaligula

The question is ‘which statement’ not ‘which statements’. It’s not multi choice question. Only answer C is correct.

alex

alex

The output:
————-
Salary OF JamesIS 78000
Salary OF MartinIS 100000
Salary OF MinakshiIS 75000
Salary OF RajnishIS 62000
Salary OF ZzerIS 100

renko

renko

Today, i passed the examen. All questions are still valid (in The Netherlands).
With this question you must choose two answers: AC