REFRESH FUNCTION

Description

REFRESH FUNCTION statement invalidates the cached function entry, which includes a class name and resource location of the given function. The invalidated cache is populated right away. Note that REFRESH FUNCTION only works for permanent functions. Refreshing native functions or temporary functions will cause an exception.

Syntax

  1. REFRESH FUNCTION function_identifier

Parameters

  • function_identifier

    Specifies a function name, which is either a qualified or unqualified name. If no database identifier is provided, uses the current database.

    Syntax: [ database_name. ] function_name

Examples

  1. -- The cached entry of the function will be refreshed
  2. -- The function is resolved from the current database as the function name is unqualified.
  3. REFRESH FUNCTION func1;
  4. -- The cached entry of the function will be refreshed
  5. -- The function is resolved from tempDB database as the function name is qualified.
  6. REFRESH FUNCTION db1.func1;