Start of change

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

Explanation

One of the following situations occurred:

  • A function resolved to a specific function that is not valid in the context where it is used.
  • UNNEST was used in a context in which it is not allowed.
object-name
The name of the object.
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.

If the error is for an invalid use of UNNEST, specific-name is *N.

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.
  • A generic table function is referenced, but a typed-correlation-clause is not specified.
  • A typed-correlation-clause is specified, but the referenced function is not a generic table function.
  • UNNEST was specified in an unsupported context.
  • A CORRELATION, COVARIANCE, COVARIANCE_SAMP or ARRAY_AGG set function is referenced where a CUBE, ROLLUP or GROUPING SETS clause exists in the same SQL statement.
  • ARRAY_AGG is referenced in a fullselect that includes an ORDER BY clause or a DISTINCT clause.
  • Start of changeThe operand for the ARRAY_AGG function references a scalar fullselect.End of change
  • ARRAY_AGG or LISTAGG is referenced in a fullselect that includes an ORDER BY clause or a DISTINCT clause.

System action

The statement cannot be processed.

Programmer response

For a function, 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