begin
insert into TMP_MLBrandSALE(saleno,plucode,depcode,depname,htcode,htname,shpcode,shpname,cntarea,manascope,xscount,hxtotal,hmtotal,qs)
select saleno,substr(c.plucode,1,4),c.depcode,c.depname,a.htcode,a.htname,shpcode,shpname,a.cntarea,a.manascope,c.xscount,c.hxtotal,hmtotal,'0'
from vhtdep a right join (TSALPLUDETAIL201207) c on c.cntid=a.cntid where c.orgcode='1009' and c.depcode like
'%11%' and c.depcode in (select depcode from tusrrightorg where orgcode='1009') and rptdate between '2012-07-01' and '2012-07-01';
insert into TMP_MLBrandSALE(saleno,plucode,depcode,depname,htcode,htname,shpcode,shpname,cntarea,manascope,xscount,hxtotal,hmtotal,qs)
select saleno,substr(c.plucode,1,4),c.depcode,c.depname,a.htcode,a.htname,shpcode,shpname,a.cntarea,a.manascope,c.xscount,c.hxtotal,hmtotal,'1'
from vhtdep a right join (TSALPLUDETAIL201206) c on c.cntid=a.cntid where c.orgcode='1009' and c.depcode like
'%11%' and c.depcode in (select depcode from tusrrightorg where orgcode='1009') and rptdate between '2012-06-01' and '2012-06-01';
insert into TMP_MLBrandSALE(saleno,plucode,depcode,depname,htcode,htname,shpcode,shpname,cntarea,manascope,xscount,hxtotal,hmtotal,qs)
select saleno,substr(c.plucode,1,4),c.depcode,c.depname,a.htcode,a.htname,shpcode,shpname,a.cntarea,a.manascope,c.xscount,c.hxtotal,hmtotal,'2'
from vhtdep a right join (TSALPLUDETAIL201107) c on c.cntid=a.cntid where c.orgcode='1009' and c.depcode like
'%11%' and c.depcode in (select depcode from tusrrightorg where orgcode='1009') and rptdate between '2011-07-01' and '2011-07-01';
end;
在PLSQL中执行没问题,但是在帆软中,报错
ORA-06550: 第 1 行, 第 6 列:
PLS-00103: 出现符号 ""在需要下列之一时:
begin case declare exit for
goto if loop mod null pragma raise return select update while
with
<< close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
符号 "" 被忽略。
ORA-06550: 第 2 行, 第 135 列:
PLS-00103: 出现符号 ""在需要下列之一时:
( select values
符号 "" 被忽略。
ORA-06550: 第 3 行, 第 144 列:
PLS-00103: 出现符号 ""在需要下列之一时:
, * & - + / at mod remainder
rem
as from || multiset