ITPub博客

首页 > 数据库 > Oracle > 2 create or replace procedure

2 create or replace procedure

原创 Oracle 作者:qinglory 时间:2008-08-01 15:01:34 0 删除 编辑

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

<< close current delete fetch lock insert

LINE/COL ERROR
-------- -----------------------------------------------------------------
open rollback savepoint set sql execute commit forall merge
pipe

修改后的脚本:

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
没有错误。

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/77164/viewspace-1008284/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 1 简单的plsql
下一篇: 3 execute procedure
请登录后发表评论 登录
全部评论

注册时间:2008-08-01

  • 博文量
    23
  • 访问量
    116106