exam questions

Exam 1z0-148 All Questions

View all questions & answers for the 1z0-148 exam

Exam 1z0-148 topic 1 question 50 discussion

Actual exam question from Oracle's 1z0-148
Question #: 50
Topic #: 1
[All 1z0-148 Questions]

Examine the structure of the EMP table:
Name Null? Type
------------------ -------------- ---------------------
EMPNO NOT NULL NUMBER (4)
ENAME VARCHAR2 (10)
SAL NUMBER (7, 2)
Examine this code:

Which code should be inserted to display the collection contents?

  • A. 1_indx := 1_list.FIRST; WHILE (1_indx IS NOT NULL) LOOP DBMS_OUTPUT.PUT_LINE (1_indx || || 1_list (1_indx)); 1_indx := 1_emp.NEXT (1_indx); END LOOP;
  • B. FOR indx IN 1_list. COUNT .. -1 LOOP DBMS_OUTPUT.PUT_LINE (indx | | | | 1_list (indx)); END LOOP;
  • C. FOR indx IN -1 .. 1_list.LIMIT LOOP DBMS_OUTPUT.PUT_LINE (indx | | | | 1_list (indx) ); END LOOP;
  • D. FOR indx IN 1_list.FIRST . . 1_list.LAST LOOP DBMS_OUTPUT.PUT_LINE (indx | | | | 1_list (indx));
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
vuis
Highly Voted 5 years, 4 months ago
A is correct answer
upvoted 5 times
...
DmitryPDN
Highly Voted 5 years, 3 months ago
A is correct. D takes all integers between first and last. So when it came to the items which had been deleted then you will get an error "no_data_found"
upvoted 5 times
...
chrishillinger
Most Recent 2 years, 9 months ago
Selected Answer: A
A is correct, only real choice for sparse collections like we have here
upvoted 1 times
...
CosminCof
4 years, 6 months ago
A is right
upvoted 2 times
...
gusa
4 years, 9 months ago
D don't have end loop. if you put it then : ORA-06512: en línea 25 01403. 00000 - "no data found" C: for indx IN -1 ... Cause error ORA-06502: PL/SQL: B: ok A: l_idx := l_emp.NEXT (l_idx); END LOOP; don't exist l_emp a:
upvoted 1 times
gusa
4 years, 9 months ago
sorry B: works but don't show anything A is correct if you change l_emp for l_list. it show all records
upvoted 2 times
...
...
Adela_bg
4 years, 11 months ago
A is correct
upvoted 1 times
Adela_bg
4 years, 11 months ago
with correction DBMS_OUTPUT.PUT_LINE (indx || ' ' || l_list (indx)); indx := l_list.NEXT (indx);
upvoted 1 times
...
...
Tinamoran
5 years, 7 months ago
D is the right answer
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...