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!

updating / inserting into a VARRAY element of a table

user600378Jun 26 2008 — edited Jun 26 2008
Hi all,

I'm trying to create a procedure that would update my varray in a table. The table consists of an id field, some personal details like name, surname, address, and a collection type phones varray(3) of varchar(15), that is a field in the table.
Here's my procedure :

create or replace procedure add_phone_num( person_id integer, phone_no varchar )
as
lvr phones;
begin
select p.tel into lvr from people p where p.id_details = person_id;
if ( lvr.count = 1 ) and ( lvr(1) like 'none' ) then
update the(select p.tel from people p where p.id_details = person_id)
set column_value = phone_no;
end if;
end;


( the tel field is the name of the phones varray column )
the procedure compiles without errors, but when I try to execute it like :

exec add_phone_num(1,'643-12-12');

I get an ORA-25015: cannot perform DML on this nested table view column error.

What am I doing wrong ?

Message was edited by:
user600378
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2008
Added on Jun 26 2008
3 comments
628 views