Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can I update contents of a collection as if its a Table ?

552969Dec 16 2008 — edited Dec 18 2008
Hi,

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..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 14 2009
Added on Dec 16 2008
8 comments
2,550 views