Array type assignments

For array types, the validity of an assignment to an SQL array variable or parameter is determined according to the following rules:

  • If the right hand side of the assignment is an SQL array variable or parameter, the TRIM_ARRAY function, or a CAST expression, then its type must be the same type as the SQL array variable or parameter on the left hand side of the assignment.
  • If the right hand side of the assignment is an array constructor or the ARRAY_AGG function, then it is implicitly cast to the type of the SQL array variable or parameter on the left hand side.