Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Update of the object table
Our case is a bit different -- there is NO physical object table.
The only table that needs to be updated is the table of object type (a
memory table), so the construct of the type:
UPDATE TABLE(SELECT * FROM aMemoryTab) A
SET A.N1 = 0;
does not work -- I get the following error message:
PL/SQL: SQL Statement ignored
PLS-00201: identifier 'AMEMORYTAB' must be declared
It is the memory table that needs to be updated... Any suggestions?
Thank you!
alex_at_sinoma.com (Alex Vilner) wrote in message news:<22e9f6e0.0208211305.3558fc28_at_posting.google.com>...
> Hello!
>
> I have the following structures defined:
> CREATE OR REPLACE TYPE TEST_TYPE AS OBJECT
> (
> N1 NUMBER (5)
> ,C1 VARCHAR2(9)
> )
> /
>
> CREATE OR REPLACE TYPE TEST_TYPE_TABLE AS TABLE OF TEST_TYPE
> /
>
> In the stored proc, I declare and populate the object table:
>
> lMemoryTab TEST_TYPE_TABLE;
>
> CURSOR lCursor IS
> SELECT ...
> FROM YYY;
>
> OPEN lCursor;
>
> FETCH lCursor BULK COLLECT
> INTO lMemoryTab;
>
> I also need to update the table -- as if it was a regular table. Since
> it has "columns", I can do a SELECT:
> SELECT * FROM TABLE( CAST( lMemoryTab AS TEST_TYPE_TABLE) );
>
> But can I do the UPDATE with a WHERE Clause, for example? I do not
> need the update that references the specific row in this memory table,
> but rather does a SQL-like update.
>
> Thank you!
Received on Thu Aug 22 2002 - 07:03:13 CDT