oracle 删除trigger 创建视图 导出表结构

1、删除trigger 

 

drop trigger tib_operationondata(trigger的名称);

 

2、创建视图

 

create view OLAP_SQAndNYERPDEPLOYSON
  (STATDATE,GUIKOUDEPID,OUTWAREHOUSEID,INWAREHOUSEID,BRIEFID,PROFESSIONALID,SPECIFYID,CASHBUDGETID,PRICE,AMOUNT,ISWORN,jine,sqspecifyid,sqamount,sqprice,sqjine)
as
select
 to_char(p.CREATEDATE,'yyyymmdd') as STATDATE,
 p.GUIKOUDEPARTMENTID as GUIKOUDEPID,
 p.OUTWAREHOUSEID,
 p.INWAREHOUSEID,
 p.BRIEFID
 p.PROFESSIONALID ,
 m.SPECIFYID,
 s.ID as CASHBUDGETID,
 m.PRICE,
 sum(m.AMOUNT) as AMOUNT,
 m.ISWORN,
 sum(m.PRICE*m.AMOUNT) as jine,
 fm.SPECIFYID as sqspecifyid,
 sum(fm.amount) as sqamount,
 fm.PRICE as sqprice,
 sum(fm.PRICE*fm.AMOUNT) as sqjine
from
 (MATERIALOFNYERPDEPLOYSONPAPER m
 inner join
  (NYERPDEPLOYSONPAPER p
   inner join
    (BUDGETDETAILS b
     inner join CASHBUDGET s
     on  b.CASHBUDGETID=s.id
    )
    on p.BUDGETDETAILSID = b.id
  )
  on m.NYERPDEPLOYSONPAPERID=p.id
 inner join  MATERIALOFNYERPDEPLOYPAPER fm
  on m. MATERIALOFNYERPDEPLOYID=fm.ID
 )
where
 (p.AUDITINGTAG='4' or p.AUDITINGTAG='2')
 and s.islafe=1
group by (
 to_char(p.CREATEDATE,'yyyymmdd'),
 p.GUIKOUDEPARTMENTID,
 p.OUTWAREHOUSEID,
 p.INWAREHOUSEID,
 p.BRIEFID,
 p.PROFESSIONALID,
 m.SPECIFYID,
 m.MATERIALOFNYERPDEPLOYID,
 s.ID,
 m.PRICE,
 m.ISWORN,
 fm.PRICE,
 fm.specifyid)

 

3、导出表结构

 

exp test/123456@myoracle file=d:/test.dmp rows=n

 

 

没有更多推荐了,返回首页