--代码
create type prodItem as object ( item varchar2(3));create type prodItemList as varray(256) of prodItem;
create table pers_prod_result
(
cino varchar2(20),
prod prodItemList,
workdate varchar2(10)
);create  type prodItem_Table as table of prodItemselect * from pers_prod_resultinsert into pers_prod_result values('160200000000001',prodItemList(prodItem('001'),prodItem('002')),'2010-06-30')update table (select b.prod from pers_prod_result b) a set a.item = '008'update语句老是更新不了,郁闷,报ORA-25015错误
求高手帮忙

解决方案 »

  1.   

    dml 语句无法通过 table 表达式更新 varray 类型列,只能更新 nested table 类型列。create or replace type item_obj_typ is object (item number);
    /create or replace type item_tab_typ is table of item_obj_typ;
    /create table items (id char(4), itemlist item_tab_typ)
    nested table itemlist store as item_tab;
    /insert into items values('001', item_tab_typ(item_obj_typ(1), item_obj_typ(2)));
    commit;update table(select itemlist from items where id='001') set item=item+1;
    commit;select id,item from items,table(itemlist);
      

  2.   

    谢谢 xman_78tom ,现在改变方案了