TO:tian00weiwei(weiwei)
我创建如下存储过程
==========================================================================
create or replace procedure sp_test123 is
begin
for i in select a,b from aa1 where aa1.a = aa2.a
update aa2
set b=i.b
where a=i.a;
Error: PLS-00103: 出现符号 "SELECT"在需要下列之一时:
( - + case mod new null
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> reverse avg count current max min prior sql
stddev sum variance execute forall merge <a SQL statement>
time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
符号 "(" 被替换为 "SELECT" 后继续。
Line: 3
Text: for i in select a,b from aa1 where aa1.a = aa2.a;
Error: PLS-00103: 出现符号 ";"在需要下列之一时:
. ( ) * @ % & - + / at for
mod rem <an exponent (**)> and or group having intersect
minus order start union where connect ||
Line: 3
Text: for i in select a,b from aa1 where aa1.a = aa2.a;
Error: PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
end not pragma
final instantiable order overriding static member constructor
map
Line: 9
==========================================================================
在SQL Plus中,出现如下信息:
未知的命令开头 "for i in s..." - 忽略了剩余的行。
==========================================================================
我对Oracle不熟悉,请问是什么原因?