nerdexam
Oracle

1Z0-146 · Question #105

The result cache is enabled for the database instance. Examine the following code for a PL/SQL function: CREATE OR REPLACE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR RESULT_CACHE…

The correct answer is C. Add a format mask parameter, such as RETURN TO_CHAR(date_hired, fmt) to GET_HIRE_DATE. D. Change the return type of GET_HIRE_DATE to DATE and have each session invoke the TO_CHAR. See the full explanation below for the reasoning.

Question

The result cache is enabled for the database instance. Examine the following code for a PL/SQL function:

CREATE OR REPLACE FUNCTION get_hire_date (emp_id NUMBER) RETURN VARCHAR RESULT_CACHE RELIES_ON (HR.EMPLOYEES) IS date_hired DATE; BEGIN SELECT hire_date INTO date_hired FROM HR.EMPLOYEES WHERE EMPLOYEE_ID = emp_id; RETURN TO_CHAR(date_hired); END; You notice that results for the functions are not used effectively. What do you recommend for better utilization of the result cache? (Choose all that apply.)

Options

  • ASet the RESULT_CACHE_MODE parameter to FORCE.
  • BIncrease the value for the RESULT_CACHE_MAX_SIZE parameter.
  • CAdd a format mask parameter, such as RETURN TO_CHAR(date_hired, fmt) to GET_HIRE_DATE.
  • DChange the return type of GET_HIRE_DATE to DATE and have each session invoke the TO_CHAR

How the community answered

(30 responses)
  • A
    10% (3)
  • B
    17% (5)
  • C
    73% (22)

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice