nerdexam
Oracle

1Z0-146 · Question #130

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 A. If sessions have different NLS_DATE_FORMAT settings, cached results have different formats. 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; Which statement is true in this scenario?

Options

  • AIf sessions have different NLS_DATE_FORMAT settings, cached results have different formats.
  • BThe function results are not cached because the query used in the function returns the DATE data type.
  • CIf sessions have different NLS_DATE_FORMAT settings, cached results have same formats because
  • DIf a function is executed with same argument value but different NLS_DATE_FORMAT for the session,

How the community answered

(40 responses)
  • A
    80% (32)
  • B
    13% (5)
  • C
    5% (2)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice