exam questions

Exam 1z0-148 All Questions

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

Exam 1z0-148 topic 1 question 27 discussion

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

Which two blocks of code execute successfully?

  • A. DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type; BEGIN my_tab (1) :=1; END;
  • B. DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type := tab_type(2); BEGIN my_tab(1) :=55; END;
  • C. DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type; BEGIN my_tab. EXTEND (2); my_tab (1) := 55; END;
  • D. DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type; BEGIN my_tab := tab_type (); my_tab (1) := 55; END;
  • E. DECLARE TYPE tab_type IS TABLE OF NUMBER my_tab tab_type := tab_type (2, NULL, 50); BEGIN my_tab.EXTEND (3, 2);
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

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
Tinamoran
Highly Voted 5 years, 3 months ago
B and E are the right answer
upvoted 11 times
...
Wrath
Highly Voted 5 years, 3 months ago
B and E
upvoted 8 times
...
Rakeshpro
Most Recent 2 years, 4 months ago
Selected Answer: BE
DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type; BEGIN my_tab (1) :=1; END; -- Reference to uninitialized collection DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type := tab_type(2); BEGIN dbms_output.put_line(my_tab(1)); --2 my_tab(1) :=55; dbms_output.put_line(my_tab(1)); --55 END; -- Executes successfully DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type; BEGIN my_tab. EXTEND (2); my_tab (1) := 55; END; -- Reference to uninitialized collection DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type; BEGIN my_tab := tab_type(); my_tab (1) := 55; END; -- Subscript beyond count
upvoted 1 times
Rakeshpro
2 years, 4 months ago
DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type; BEGIN my_tab := tab_type(); --dbms_output.put_line(my_tab(1)); -- Subscript beyond count my_tab.EXTEND; my_tab(1) := 55; dbms_output.put_line(my_tab(1)); --55 END; -- Executes successfully DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type := tab_type (2, NULL, 50); BEGIN dbms_output.put_line(my_tab(1) || ':' || my_tab(2) || ':' || my_tab(3)); my_tab.EXTEND(3,2); -- Append three copies of second element, here NULL value dbms_output.put_line(my_tab(1) || ':' || my_tab(2) || ':' || my_tab(3) || ':' || my_tab(4) || ':' || my_tab(5)); END; -- Executes successfully
upvoted 1 times
...
...
chrishillinger
2 years, 5 months ago
Selected Answer: BE
BE is correct, only ones using correct initialization
upvoted 1 times
...
CosminCof
4 years, 2 months ago
BE is correct
upvoted 2 times
...
certyk
4 years, 4 months ago
The ANs E missing ";" "end;". Anyhow i check it and seems that the correct answers are BC. The answer E could be fine if it was : "DECLARE TYPE tab_type IS TABLE OF NUMBER; my_tab tab_type := tab_type (2, NULL, 50); BEGIN my_tab.EXTEND (3, 2); END;" and not DECLARE TYPE tab_type IS TABLE OF NUMBER my_tab tab_type := tab_type (2, NULL, 50); BEGIN my_tab.EXTEND (3, 2);
upvoted 1 times
certyk
4 years, 4 months ago
sorry, C cannot be the correct answer cause: ORA-06533; Correct ans BE
upvoted 1 times
...
...
szefco
4 years, 8 months ago
B and E
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