exam questions

Exam 1z0-148 All Questions

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

Exam 1z0-148 topic 1 question 35 discussion

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

Examine this code:

Which two corrections must be applied for this anonymous block to execute successfully?

  • A. Change RETURN p_tab.LAST to RETURN p_tab.COUNT.
  • B. Declare the collection type inside the function.
  • C. Declare the collection type at the schema level instead of the package.
  • D. Define the function as stand-alone instead of in a package body.
  • E. Change the INDEX BY clause from VARCHAR2 to PLS_INTEGER.
  • F. Modify the function return type to return a scalar, VARCHAR2.
Show Suggested Answer Hide Answer
Suggested Answer: DE 🗳️

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
orakell
Highly Voted 5 years, 6 months ago
EF, not DE.
upvoted 6 times
...
chrishillinger
Most Recent 2 years, 9 months ago
Selected Answer: EF
EF should be correct
upvoted 1 times
...
CosminCof
4 years, 6 months ago
EF correct
upvoted 2 times
...
vlad4475
4 years, 8 months ago
Yea, EF correct. Checked here: CREATE package pkg as type tab_typ is table of varchar2(10) index by PLS_INTEGER; function tab_end (p_tab in tab_typ) return varchar2; end pkg; / create package body pkg as function tab_end(p_tab in tab_typ) return varchar2 is begin return p_tab.last; end; end pkg; / declare l_stmt varchar2(100); l_list pkg.tab_typ; l_result varchar2(10); begin l_list(1) := 'Mon'; l_list(2) := 'Tue'; l_stmt := 'SELECT pkg.tab_end(:l_list) into :i_result from dual'; execute immediate l_stmt into l_result using l_list; dbms_output.put_line(l_result); end;
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 ...