Compilation errors for PROCEDURE ICD.SP_RPT_OUTMANUALBYSTAFFNOError: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
Line: 96
Text: ( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename) ,Error: PLS-00103: Encountered the symbol "," when expecting one of the following:
; return returning and or
Line: 96
Text: ( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename) ,Error: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
Line: 100
Text: ( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename)Error: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
Line: 102
Text: a.num*100.0/( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename)Error: PLS-00103: Encountered the symbol ")" when expecting one of the following:
, * & - + / at mod rem <an identifier>
<a double-quoted delimited-identifier> <an exponent (**)> as
from ||
Line: 103
Text: ),2),Error: PLS-00103: Encountered the symbol "1" when expecting one of the following:
( <an identifier> <a double-quoted delimited-identifier>
table the
Line: 106
Text: 1,Error: PLS-00103: Encountered the symbol "DELETE"
Line: 114
Text: DELETE t_Tmp_OutManualByStaffNo WHERE vdnusername=iVDNUserName and flag=0;Error: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
begin function package pragma procedure form
Line: 181Error: Hint: Value assigned to 'tCityID' never used in 'SP_Rpt_OutManualByStaffNo'
Line: 31
Text: WHERE a.userid=iVDNUserName AND a.usergid=b.name;
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
Line: 96
Text: ( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename) ,Error: PLS-00103: Encountered the symbol "," when expecting one of the following:
; return returning and or
Line: 96
Text: ( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename) ,Error: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
Line: 100
Text: ( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename)Error: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
Line: 102
Text: a.num*100.0/( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename)Error: PLS-00103: Encountered the symbol ")" when expecting one of the following:
, * & - + / at mod rem <an identifier>
<a double-quoted delimited-identifier> <an exponent (**)> as
from ||
Line: 103
Text: ),2),Error: PLS-00103: Encountered the symbol "1" when expecting one of the following:
( <an identifier> <a double-quoted delimited-identifier>
table the
Line: 106
Text: 1,Error: PLS-00103: Encountered the symbol "DELETE"
Line: 114
Text: DELETE t_Tmp_OutManualByStaffNo WHERE vdnusername=iVDNUserName and flag=0;Error: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
begin function package pragma procedure form
Line: 181Error: Hint: Value assigned to 'tCityID' never used in 'SP_Rpt_OutManualByStaffNo'
Line: 31
Text: WHERE a.userid=iVDNUserName AND a.usergid=b.name;
解决方案 »
- 删除不了同义词,求大神
- 我这样的设计表会后患无穷吗?
- 关于 SELECT * FROM WHERE AA IN () 中的最大记录数的问题
- 查询速度的问题
- oracle要钱吗
- 查询间断数字的sql
- 抢分了 ! 如何通过SQL语句得到类似于Listener.log文件中的信息 , 包括登入用户名, 登入program ,ip , pc机器名 , 登入时间 ,所做的动作(s
- 建立快照时出错
- 请教oracle 中的internal(登陆时用的名称)是用户名吗?为什么在用户/role中找不到?
- oracle往导入数据时需要的表空间变得很大导致导入中断
- "ORA-00604: 递归 SQL 层 1 出现错误 ORA-00942: 表或视图不存在" 我删除表的一列时报这样的错,有人说是权限的问题,不知是少什么权限?
- Oracle8中修改db_block_size需要重装Oracle吗?
INSERT INTO t_Tmp_OutManualByStaffNo (
stattime,
servicename,
status,
totalnum,
num,
rate,
totaltimes,
avgtimes ,
flag,
vdnusername)
(SELECT /*改这里*/
a.stattime,
c.servicename,
b.memo,
( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename) ,
a.num,
round(decode
(
( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename)
,0,0,
a.num*100.0/( select sum(num) from t_Tmp_OutManualByStaffNo where stattime=a.stattime and servicename =a.servicename)
),2),
a.totaltimes,
a.avgtimes,
1,
iVDNUserName
FROM t_Tmp_OutManualByStaffNo a,t_tmp_status b,T_tmp_OutBoundService c
WHERE b.status=a.status
AND a.servicename=c.serviceid
AND a.vdnusername=iVDNUserName
ORDER BY a.stattime,a.servicename;
...
1.在过程中insert into table select ... from tab语句后不能加order by,但过程外肯定可以.
2.在过程中子查询不能作为列,但可以当成表使用;过程外,子查询可以作为表,列使用.我得出这两个结论,都是基于多次测试的结果.觉得很不爽的是,过程内的语句限制太多.各位
也可以做些简单的测试,估计平常也没注意到这两点,都动手试试吧,看看大家的结论和我是否相同
--------------------
楼上,我注释掉就没有错误了.我做了下测试,得到了两个结论,大家指教.
1.在过程中insert into table select ... from tab语句后不能加order by,但过程外肯定可以.
2.在过程中子查询不能作为列,但可以当成表使用;过程外,子查询可以作为表,列使用.我得出这两个结论,都是基于多次测试的结果.觉得很不爽的是,过程内的语句限制太多.各位
也可以做些简单的测试,估计平常也没注意到这两点,都动手试试吧,看看大家的结论和我是否相同
测试版本 oracle 8.1.6
你以后用在查询表用order by一样的呀
子查询作为表(from list) oracle称为 inline-viewscalar subquery按照oracle的说法是9i才支持,并且9i第一版的pl/sql不支持。