Start of change

-584 INVALID USE OF NULL OR DEFAULT

Explanation

The NULL or DEFAULT keyword is not valid as specified. One of the following error situations occurred:

  • The NULL keyword was used in the USING source-table clause of the MERGE statement, but the NULL keyword was not explicitly cast to a supported data type.
  • Start of changeIn a SET assignment-statement statement, DEFAULT was assigned to a variable other than a global variable.End of change
  • A CREATE VARIABLE statement was used to define a global variable as an array type. The DEFAULT constant or DEFAULT special-register clause was specified in the CREATE VARIABLE statement. Only DEFAULT NULL is allowed.
  • Start of changeThe DEFAULT keyword was specified as the source value for a transition variable in a SET assignment-statement statement that assigns values to multiple targets, and either all of the targets were not transition variables, or all of the source values were not specified with the DEFAULT keyword.End of change

System action

The statement cannot be processed.

User response

Take one of the following actions:

  • Specify the NULL keyword within a CAST expression when using NULL within the USING VALUES clause of the MERGE statement.
  • Do not assign DEFAULT to any variable other than a global variable.
  • In a CREATE VARIABLE statement that is used to define a global variable as an array type, do not assign DEFAULT constant or DEFAULT special-register to the global variable.
  • Start of changeDo not assign DEFAULT to a transition variable in a SET assignment-statement statement that assigns values to multiple targets if all the targets are not transition variables, or if all the source values are not specified as the DEFAULT keyword. Replace the single assignment statement with separate assignment statements.End of change

SQLSTATE

42608

End of change