create or replace view lj_vdj_vw_outbillbody as
select d.vbillcode as FLD01 ,e.invcode as FLD02 ,e.invname as FLD03,e.invspec as FLD04 ,c.noutassistnum as FLD05,e.invtype as FLD06, c.noutnum as FLD07,
f.def1 as FLD08,f.def2 as FLD09
from ic_general_b c left join bd_invbasdoc e on c.cinvbasid=e.pk_invbasdoc and c.dr=0 and e.dr=0
left join Ic_General_h d  on c.cgeneralhid=d.cgeneralhid and c.dr=0 and d.dr=0
left join bd_invmandoc f  on f.pk_invbasdoc=e.pk_invbasdoc and f.dr=0 and f.pk_corp='1004'
where d.cbilltypecode='4Y' and d.dr=0创建了这样一个视图 
在VB 中执行
select FLD08,FLD03,FLD05,FLD07,FLD02 from VW_OutBillBody Where FLD01 ='C101200002'就出现错误 
ora_01445: cannot select rowid from,or sample,a join view without a key-preserved tableora_02063 紧接着  line(起自 asmdb1)
ora_02063 紧接着2  line(起自 orcl)

解决方案 »

  1.   


    这个VW_OutBillBody是从哪里来的??
      

  2.   

    ora_01445: cannot select rowid from,or sample,a join view without a key-preserved table
    不能从一个非键留表的视图中取rowid,如果要从视图中取rowid,则需要在视图中包含一个表的主键
    并且在视图中也相当于主键
      

  3.   

    没看明白 单从错误信息上看 应该是rowid没用对,视图中不能这么用 楼上正解
      

  4.   

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:548422757486看下吧