exam questions

Exam 1z0-148 All Questions

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

Exam 1z0-148 topic 1 question 13 discussion

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


Examine this code:

You want to display the contents of CREATE_LIST.
Which two lines need to be corrected in the PL/SQL block?

  • A. Line 2
  • B. Line 3
  • C. Line 5
  • D. Line 6
  • E. Line 7
Show Suggested Answer Hide Answer
Suggested Answer: AE 🗳️

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
pmeyer
1 year, 8 months ago
Selected Answer: AE
Answers are A & E
upvoted 1 times
...
Angelos_ang
2 years, 4 months ago
Selected Answer: AE
Answers are A & E
upvoted 1 times
...
Rakeshpro
2 years, 4 months ago
CREATE OR REPLACE PACKAGE yearly_list IS TYPE list1 IS TABLE OF VARCHAR2 (20) INDEX BY PLS_INTEGER; FUNCTION init_list1 RETURN list1; END yearly_list; / CREATE OR REPLACE PACKAGE BODY yearly_list IS FUNCTION init_list1 RETURN list1 IS create_list list1; BEGIN create_list(1) := 'Jan'; create_list(3) := 'Feb'; create_list(6) := 'Mar'; create_list(8) := 'Apr'; RETURN create_list; END init_list1; END yearly_list; /
upvoted 2 times
Rakeshpro
2 years, 4 months ago
DECLARE --v_yrl yearly_list.create_list(); --ERROR --line2 v_yrl yearly_list.list1 := yearly_list.init_list1(); --CORRECT location NUMBER := 1; BEGIN WHILE location IS NOT NULL LOOP DBMS_OUTPUT.PUT_LINE(v_yrl(location) || ' ' || v_yrl.NEXT(location)); --location := v_yrl.NEXT; --ERROR --line7 -- PLS-00306: wrong number or types of arguments in call to 'NEXT' location := v_yrl.NEXT(location); --CORRECT END LOOP; END; /
upvoted 2 times
Rakeshpro
2 years, 4 months ago
Answer is A & E
upvoted 2 times
...
...
...
chrishillinger
2 years, 5 months ago
Selected Answer: AE
As already said AE, are correct
upvoted 1 times
...
Benjmaz
4 years ago
Line 2, 6 and 7. Correct code should look like this DECLARE v_yrl yearly_list.list1 := yearly_list.init_list1(); location NUMBER := 1; BEGIN WHILE location IS NOT NULL LOOP DBMS_OUTPUT.PUT_LINE(v_yrl(location)); location := v_yrl.NEXT(location); END LOOP; END;
upvoted 1 times
...
sudhirdavim
4 years, 1 month ago
A and E are correct answer.
upvoted 1 times
...
CosminCof
4 years, 2 months ago
AE correct answer
upvoted 1 times
...
jcamt
4 years, 3 months ago
verified 2 and 6, the error in 2 is PLS-00103: Encountered the symbol ")" and the 6 the error is DBMS_PUTPUT
upvoted 1 times
...
DmitryPDN
5 years ago
Line 2 is wrong because new variable requires type for itself. Line 7 is wrong since collection attribute next requires as input parameter the index of existing element from which we want to find next one like this array.next(curr_index).
upvoted 2 times
...
yurijk
5 years ago
Line 2, line 7 -> A, E
upvoted 3 times
...
orakell
5 years, 2 months ago
Line 3 is fine. Line 2 needs a lot of fixing, but I suspect this question has more issues in it.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago