Can I update contents of a collection as if its a Table ?
552969Dec 16 2008 — edited Dec 18 2008Hi,
Is it possible to update contents of a collection treating it as a table (expecting cast to come in handy here) ?
Well, we have a rather complex piece of functionality, which we want to break into multiple simpler pieces. The idea is to fetch data in the first of those steps and keep into a collection. The collection is then subjected to other DML operations (basically filtering in different steps based on diff conditions).
I want to achieve something like this -
update table(cast(<collection_name> as <type_name)) t1
set t1.column_name = <whatever_value>
where ...
But I keep getting this compilation error - invalid table name+, and PL/SQL: ORA-22905: cannot access rows from a non-nested table item*
Conceptually, after reading about cast and collections, it should be allowed to perform standard DML operations on a collection.
However, being new to collections myself, I wonder if my understanding is actually correct. Has anyone tried something simiilar ?
please suggest
raghav..