This result cache is enabled for the database instance. Examine this code for a PL/SQL function: Which two actions would ensure that the same result will be consistently returned for any session when the same input value is passed to the function?
A.
Add a parameter, fmt, and change the RETURN statement to: RETURN TO_CHAR (date_hired, fmt);
B.
Set the RESULT_CACHE_MODE parameter to FORCE.
C.
Increase the value for the RESULT_CACHE_MAX_SIZE parameter.
D.
Change the return type of GET_HIRE_DATE to DATE and have each session invoke the TO_CHAR function.
E.
Set the RESULT_CACHE_MAX_RESULT parameter to 0.
A and D
Some possible solutions to this problem are:
Change the return type of get_hire_date to DATE and have each session invoke the TO_CHAR function.
If a common format is acceptable to all sessions, specify a format mask, removing the dependency on NLS_DATE_FORMAT. For example:
TO_CHAR(date_hired, 'mm/dd/yy');
Add a format mask parameter to get_hire_date. For example:
CREATE OR REPLACE FUNCTION get_hire_date
(emp_id NUMBER, fmt VARCHAR) RETURN VARCHAR
RESULT_CACHE
IS
date_hired DATE;
BEGIN
SELECT hire_date INTO date_hired
FROM HR.EMPLOYEES
WHERE EMPLOYEE_ID = emp_id;
RETURN TO_CHAR(date_hired, fmt);
END;
/
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.1z0-148 Exam Questions
Log in to ExamTopics
Sign in:
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.
kahabe59
Highly Voted 5 years, 1 month agochrishillinger
Most Recent 2 years, 8 months agoCosminCof
4 years, 6 months agoAdela_bg
4 years, 9 months ago