exam questions

Exam 1z0-148 All Questions

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

Exam 1z0-148 topic 1 question 16 discussion

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

Examine this code:

What is the correct statement to get the value of attribute ACCOUNT_MGR after the procedure has been executed?

  • A. SELECT USERENV (‘ACCOUNT_MGR’) FROM dual;
  • B. SELECT SYS_CONTEXT (‘USERENV’, ‘ACCOUNT_MGR’) FROM dual;
  • C. SELECT SYS_CONTEXT (‘ORDER_CTX’, ‘ACCOUNT_MGR’) FROM dual;
  • D. SELECT SYS_CONTEXT (‘ACCOUNT_MGR’, ‘ORDER_CTX’) FROM dual;
  • E. SELECT USERENV (‘ORDER_CTX’) FROM dual;
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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, 2 months ago
C, not B. Try it.
upvoted 8 times
...
Rakeshpro
Most Recent 2 years, 4 months ago
Use the CREATE CONTEXT statement to: Create a namespace for a context (a set of application-defined attributes that validates and secures an application) Associate the namespace with the externally created package that sets the context You can use the DBMS_SESSION.SET_CONTEXT procedure in your designated package to set or reset the attributes of the context.
upvoted 1 times
Rakeshpro
2 years, 4 months ago
https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_SESSION.html#GUID-CD7AE975-F4F4-4C12-B080-3DABD2D1194E
upvoted 1 times
Rakeshpro
2 years, 4 months ago
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/CREATE-CONTEXT.html#GUID-FDF62812-A884-479C-9C1B-5BD6DDEFE7FA
upvoted 1 times
Rakeshpro
2 years, 4 months ago
CREATE OR REPLACE CONTEXT ORDER_CTX USING orders_app_pkg; CREATE OR REPLACE PACKAGE orders_app_pkg IS PROCEDURE set_app_context; END; / CREATE OR REPLACE PACKAGE BODY orders_app_pkg IS c_context CONSTANT VARCHAR2(30) := 'ORDER_CTX'; PROCEDURE set_app_context IS v_user VARCHAR2(30); BEGIN SELECT user INTO v_user FROM dual; DBMS_SESSION.SET_CONTEXT(c_context, 'ACCOUNT_MGR', v_user); DBMS_OUTPUT.PUT_LINE(v_user); END; END; / declare var varchar2(2000); begin orders_app_pkg.set_app_context; SELECT SYS_CONTEXT('ORDER_CTX', 'ACCOUNT_MGR') into var FROM dual; DBMS_OUTPUT.PUT_LINE(var); end; /
upvoted 1 times
...
...
...
...
chrishillinger
2 years, 5 months ago
Selected Answer: C
C is correct
upvoted 1 times
...
CosminCof
4 years, 2 months ago
C is the correct answer
upvoted 3 times
...
peguynya
4 years, 7 months ago
the answer is C because SYS_CONTEXT(CONTEXT_NAME, PARAM1) returns the value of the parameter associated to the context namespace.
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