Update a collection variable

After you have initialized a collection host variable with a collection column, you can use the UPDATE statement with the collection-derived table clause to update the elements in the collection. The collection-derived table clause identifies the collection variable whose elements are to be updated.

The UPDATE statement and the collection-derived table clause allow you to perform the following operations on a collection variable:
  • Update all elements in the collection to the same value.

    Use the UPDATE statement (without the WHERE CURRENT OF clause) and specify a derived column name in the SET clause.

  • Update a particular element in the collection.

    You must declare an update cursor for the collection variable and use UPDATE with the WHERE CURRENT OF clause.

Neither form of the UPDATE statement can include a WHERE clause.