求Oracle高手帮忙解答
执行if中的语句,就报缺失表达式的错syqsql:='insertintotbStat6(Humanid,Ywmc,Ssq,Xgsj)select'||p_partId|...
执行if中的语句,就报缺失表达式的错
syqsql := '
insert into tbStat6(Humanid, Ywmc, Ssq, Xgsj)
select '||p_partId||',业务名称,区县名称,
count(发证时间)'||','||'sum(建筑面积)'||','||'count(1)
from (select nvl(b.jzmj, 0) 建筑面积,
c.procid 业务大类标识,
c.subbizid 业务小类标识,
e.bizname 业务名称,
to_char(c.dbsj, ''yyyy/mm/dd'') 登簿时间,
to_char(c.fzsj, ''yyyy/mm/dd'') 发证时间,
c.cantoncode 行政区划,
f.cantonname 区县名称
from cqxx a, fwzk b, tbrec c, tbbiz e, tbcanton f
where a.recid(+) = b.recid
and b.recid = c.recid(+)
and c.subbizid = e.bizid
and c.cantoncode = f.cantoncode
and a.status = 1
and b.status = 1
and c.procid=iBizid
and c.dbsj'||l_startdate||'
and c.dbsj'||l_enddate||')
group by 业务大类标识,
业务小类标识,
业务名称,
区县名称,
行政区划 order by 行政区划';
if iCount = 1 then
execute immediate syqsql;
end if; 展开
syqsql := '
insert into tbStat6(Humanid, Ywmc, Ssq, Xgsj)
select '||p_partId||',业务名称,区县名称,
count(发证时间)'||','||'sum(建筑面积)'||','||'count(1)
from (select nvl(b.jzmj, 0) 建筑面积,
c.procid 业务大类标识,
c.subbizid 业务小类标识,
e.bizname 业务名称,
to_char(c.dbsj, ''yyyy/mm/dd'') 登簿时间,
to_char(c.fzsj, ''yyyy/mm/dd'') 发证时间,
c.cantoncode 行政区划,
f.cantonname 区县名称
from cqxx a, fwzk b, tbrec c, tbbiz e, tbcanton f
where a.recid(+) = b.recid
and b.recid = c.recid(+)
and c.subbizid = e.bizid
and c.cantoncode = f.cantoncode
and a.status = 1
and b.status = 1
and c.procid=iBizid
and c.dbsj'||l_startdate||'
and c.dbsj'||l_enddate||')
group by 业务大类标识,
业务小类标识,
业务名称,
区县名称,
行政区划 order by 行政区划';
if iCount = 1 then
execute immediate syqsql;
end if; 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询