我建立的一个存储过程,里边有一部分
for I2 in curArea loop --执行计算
INSERT INTO base_userlevel
(serialnum,sysuserid,svctype,sysareacode,areacode,period,
netmonth,cenmonth,
levelvalue,areaflag,billmonth)
SELECT ROWnum, a.sysuserid, a.svctype, a.sysareacode, a.areacode, a.period,
a.netmonth, a.cenmonth,
NVL (b.levelvalue, 0) + a.fee + a.fee * I2.scale as levelvalue1,
a.areaflag,a.billmonth
FROM base_userexpbill a, base_userlevel b
WHERE a.areaflag = '01' AND b.areaflag = '01'
AND a.billmonth = '01' AND b.billmonth = '01'
AND a.sysuserid = b.sysuserid(+)
AND a.netmonth >= 1 AND a.netmonth <=12
order by levelvalue1;
commit;
end loop;但是编译的时候总是报这个错误
PLS-00103: Encountered the symbol "ORDER" when expecting one of the following:
. ( * @ % & - + ; / at mod rem return returning
<an exponent (**)> and or group having intersect minus start
union where connect ||
The symbol "group was inserted before "ORDER" to continue.这是因为什么呀?大侠们帮帮我呀!急死了!!
for I2 in curArea loop --执行计算
INSERT INTO base_userlevel
(serialnum,sysuserid,svctype,sysareacode,areacode,period,
netmonth,cenmonth,
levelvalue,areaflag,billmonth)
SELECT ROWnum, a.sysuserid, a.svctype, a.sysareacode, a.areacode, a.period,
a.netmonth, a.cenmonth,
NVL (b.levelvalue, 0) + a.fee + a.fee * I2.scale as levelvalue1,
a.areaflag,a.billmonth
FROM base_userexpbill a, base_userlevel b
WHERE a.areaflag = '01' AND b.areaflag = '01'
AND a.billmonth = '01' AND b.billmonth = '01'
AND a.sysuserid = b.sysuserid(+)
AND a.netmonth >= 1 AND a.netmonth <=12
order by levelvalue1;
commit;
end loop;但是编译的时候总是报这个错误
PLS-00103: Encountered the symbol "ORDER" when expecting one of the following:
. ( * @ % & - + ; / at mod rem return returning
<an exponent (**)> and or group having intersect minus start
union where connect ||
The symbol "group was inserted before "ORDER" to continue.这是因为什么呀?大侠们帮帮我呀!急死了!!
http://www.experts-exchange.com/Databases/Q_20916260.html
8i的在procedure中使用
insert into table1
select * from table2
order by ; --使用order by会发生错误.
但在9i中不会.