Start of change

-390   THE FUNCTION function-name, SPECIFIC NAME specific-name, IS NOT VALID IN THE CONTEXT WHERE IT IS USED

Explanation

A function resolved to a specific function that is not valid in the context where it is used.

function-name
The name of the function.
specific-name
The specific name. If specific-name is an empty string, then the function resolved to the built-in function identified by function-name.

Possible causes for this error include:

  • A scalar or aggregate function is referenced where only a table function is allowed (such as in the FROM clause of a query).
  • Start of changeA table function is referenced where only a scalar or aggregate function is allowed (such as in an expression).End of change
  • Start of changeA function is referenced in a SOURCE clause of a CREATE FUNCTION statement, but a source function cannot be defined on that function (or on that specific function signature).End of change
  • Function XMLMODIFY is referenced where it is not the topmost expression on the right side of the SET assignment clause in an update.

System action

The statement cannot be processed.

Programmer response

Ensure that the correct function name and arguments are specified and that the SQL path includes the schema where the correct function is defined. You might need to change the function name, arguments, or SQL path (using SET CURRENT PATH or the PATH bind option), or change the context in which the function is used.

SQLSTATE

42887

End of change