Start of change

-365   USE OF THE VALUE OF EXTENDED INDICATOR VARIABLE IN POSITION value-position IS NOT VALID.

Explanation

The value of DEFAULT (-5) or UNASSIGNED (-7) was used for the extended indicator variable in a context where it is not allowed. These values are allowed as indicator variables only in INSERT, UPDATE, and MERGE statements when the host variable provides the source value for a column value.

value-position
Identifies the location of the extended indicator variable value.

When extended indicator variables are enabled:

  • An expression must not be more complex than a reference to a single host variable if the indicator is set to the extended indicator values of DEFAULT (-5) or UNASSIGNED (-7), except that a CAST specification is allowed when the following conditions are met:
    • The source of the CAST specification is a single host variable.
    • The data attributes (data type, length, precision, and scale) of the host variable are the same as the result of the cast specification.
  • The extended indicator variable values of DEFAULT (-5) or UNASSIGNED (-7) must not be used in:
    • An expression that involves more than a host variable, or a host variable that is explicitly cast.
    • Any expression other than:
      • The set assignment list of an UPDATE operation.
      • The values list of an INSERT operation.
      • The expression's corresponding places in a MERGE statement.
      • The source-table parameter of a MERGE statement.
      • The select list of an INSERT statement in the FROM clause of the SELECT statement.

System action

The statement cannot be processed.

System programmer response

Change the value of the extended indicator variable to an allowable value for the context in which it is used

SQLSTATE

22539

End of change