Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: deleting a row from a varray
I should have looked a little more closely at the original question - you cannot delete individual items from a varray - you will either have to play silly games with CAST() or use an object table instead of a varray.
My comment about the SELF parameter was
also inappropriate - you are allowed to declare
the SELF parameter explicitly. In your case
you may have to because you are using a
member function and the implicit SELF for
a member function is an IN parameter, whereas
you actually want to use an IN OUT parameter.
BTW - to avoid the 'no data found' exception when looping through the table, you could use code like
if (self.luggage.exists(i)) then
And in answer to your question about the WHERE condition - it isn't part of the syntax for this type of mechanism:
if (self.luggage.exists(i)) then
if (self.luggage(i).luggage_name = food) then self.luggage.delete(i); end if;
-- Jonathan Lewis http://www.jlcomp.demon.co.uk Host to The Co-Operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html Author of: Practical Oracle 8i: Building Efficient Databases Screen saver or Life saver: http://www.ud.com Use spare CPU to assist in cancer research. Martin Buchan wrote in message <3BF4BA8F.5D54BBF8_at_gre.ac.uk>...Received on Fri Nov 23 2001 - 04:30:58 CST
>thanks for the reply.
>
>Its still not working though. What i get now is:
>
>92/5 PLS-00306: wrong number or types of arguments in call to 'DELETE'
>
>do i still need the where clause? (At present im not using it cos it
doesn't
>look to me as though i would need it with that statement)
>self.luggage.delete(i)
>
![]() |
![]() |