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!

USING MINUS OPERATOR ON TABLE TYPE

Kaushal SJun 1 2015 — edited Jun 2 2015

Hi All,

I am using Oracle 11g Database.

I want to perform a minus operation on a varray.

In the below code i want to  update based on the result from MINUS operation . I tried but it is giving ORA 06550. i think what i am trying not the proper way to use collection.

Please help

declare

TYPE array_tbl IS TABLE OF varchar(255);

  v_array         array_tbl;

begin;

select model_name bulk collect into v_array from kit_car_dim where owner='KIT' and model_name like 'FORD';

for i in 1 .. v_array.count loop;

/* i want to perform something like this */

select model_name from v_array

minus

select model_name from kit_car_dim where owner='KIT';

/* which can be used for the below update statement*/

update kit_car_dim set modified_timestamp=sysdate,model_ident='1'

where model_name=(model_name from minus operation);

end loop;

end;

This post has been answered by Solomon Yakobson on Jun 1 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 30 2015
Added on Jun 1 2015
6 comments
548 views