SQL> create or replace procedure update_commission
2 (v_dept in number,v_pervent in number default 10) is
3 begin
4 update emp
5 set comm=sal*v_percent
6 where deptno=v_dept;
7 end
8 /
警告: 创建的过程带有编译错误。
SQL> show error
PROCEDURE UPDATE_COMMISSION 出现错误:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/2 PLS-00103: 出现符号 ""在需要下列之一时:
( ; is with authid as cluster
compress order using compiled wrapped external deterministic
parallel_enable pipelined
符号 "" 被忽略。
4/2 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
LINE/COL ERROR
-------- -----------------------------------------------------------------
open rollback savepoint set sql execute commit forall merge
pipe
SQL> show errors procedure scott.update_commission
PROCEDURE SCOTT.UPDATE_COMMISSION 出现错误:
LINE/COL ERROR
-------- -----------------------------------------------------------------
2/2 PLS-00103: 出现符号 ""在需要下列之一时:
( ; is with authid as cluster
compress order using compiled wrapped external deterministic
parallel_enable pipelined
符号 "" 被忽略。
4/2 PLS-00103: 出现符号 ""在需要下列之一时:
begin case declare exit for
goto if loop mod null pragma raise return select update while
with
修改后的脚本:
SQL> create or replace procedure update_commission
2 (v_dept in number,v_pervent in number default 10) is
3 begin
4 update emp
5 set comm=sal*v_percent
6 where deptno=v_dept;
7 end;
8 /
警告: 创建的过程带有编译错误。
SQL> show error
PROCEDURE UPDATE_COMMISSION 出现错误:
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/1 PL/SQL: SQL Statement ignored
5/14 PL/SQL: ORA-00904: "V_PERCENT": 无效的标识符
SQL> create or replace procedure update_commission
2 (v_dept in number,v_percent in number default 10) is
3 begin
4 update emp
5 set comm=sal*v_percent
6 where deptno=v_dept;
7 end;
8 /
过程已创建。
SQL> show error
没有错误。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/77164/viewspace-1008284/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/77164/viewspace-1008284/