exam questions

Exam 1z0-148 All Questions

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

Exam 1z0-148 topic 1 question 20 discussion

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

Select the correct statement regarding BEQUEATH CURRENT_USER.

  • A. If a view references a PL/SQL function then BEQUEATH CURRENT_USER allows the function to execute with DBA privileges, regardless of the invoking users privileges.
  • B. The BEQUEATH CURRENT_USER clause allows invoker’s rights functions referenced in a view to execute with the privileges of the invoking user.
  • C. Any view calling a PL/SQL function with BEQUEATH CURRENT_USER in effect will execute with the privileges of the function owner.
  • D. With the BEQUEATH CURRENT_USER clause, a definer’s rights function referenced in a view executes with the privileges of the view owner, not the function
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Reference:
https://docs.oracle.com/database/121/DBSEG/dr_ir.htm#DBSEG558

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
Goto10
2 years ago
Selected Answer: B
-- AS USER HR CREATE OR REPLACE FUNCTION COUNT_ROWS RETURN NUMBER AUTHID CURRENT_USER IS l_count_countries number; l_count_jobs number; BEGIN BEGIN SELECT COUNT(*) INTO l_count_countries FROM HR.COUNTRIES; EXCEPTION WHEN OTHERS THEN l_count_countries := 0; END; BEGIN SELECT COUNT(*) INTO l_count_jobs FROM HR.JOBS; EXCEPTION WHEN OTHERS THEN l_count_jobs := 0; END; RETURN l_count_countries + l_count_jobs; END; / CREATE OR REPLACE VIEW BEQUEATH_DEFINER_COUNT_ROWS_VIEW BEQUEATH DEFINER AS SELECT HR.COUNT_ROWS FROM DUAL; CREATE OR REPLACE VIEW BEQUEATH_INVOKER_COUNT_ROWS_VIEW BEQUEATH CURRENT_USER AS SELECT HR.COUNT_ROWS FROM DUAL; GRANT SELECT ON BEQUEATH_DEFINER_COUNT_ROWS_VIEW TO PUBLIC; GRANT SELECT ON BEQUEATH_INVOKER_COUNT_ROWS_VIEW TO PUBLIC; GRANT SELECT ON COUNTRIES TO SPIDER; GRANT SELECT ON JOBS TO SUPERMAN;
upvoted 1 times
Goto10
2 years ago
-- AS Spider SELECT * FROM HR.BEQUEATH_DEFINER_COUNT_ROWS_VIEW; --44 SELECT * FROM HR.BEQUEATH_INVOKER_COUNT_ROWS_VIEW; --25 <-- since it has access only to COUNTRIES -- AS Superman SELECT * FROM HR.BEQUEATH_DEFINER_COUNT_ROWS_VIEW; --44 SELECT * FROM HR.BEQUEATH_INVOKER_COUNT_ROWS_VIEW; --19 <-- since it has access only to JOBS
upvoted 1 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