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!

joining varrays column with number column... kindly help

797013Sep 10 2010 — edited Sep 10 2010
create table vehicle(engine_mot varchar2(3),indices number(3));

insert into vehicle values('K9K',1)

insert into vehicle values('K9K',2)

create type sub_ind as varray(100) of number(3);

based on this  type i am creating a table

create table vehicle_sub(engine_sub varchar2(10),mot_typ varchar2(3),eng_ind sub_ind);

above table is created so that mot_typ wil have more indices.

insert into vehicle_sub values('SFAM-01','K9K',sub_ind(1,2));

NOW my requirement  arises  to join these table and fetch the record...


  select engine_mot,indices
 from vehicle,vehicle_sub
  where vehicle.engine_mot=vehicle_sub.mot_typ
 and  vehicle.indices=vehicle_sub.eng_ind
and  vehicle.indices=vehicle_sub.eng_ind
ERROR at line 4:
ORA-00932: inconsistent datatypes: expected NUMBER got SEN.SUB_IND                     *
how can i join the number column to varray column in vehicle_sub..?

is it possible.?

H
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2010
Added on Sep 10 2010
4 comments
559 views