number,p_shipdate date,p_total number)
2 is
3 e_integrity exception;
4 e_shipdate exception;
5 pragma exception_init(e_integrity,-2291);
6 begin
7 if p_shipdate >= p_orddate then
8 insert into ord values(p_ordid,p_orddate,p_custid,p_shipdate,p_total);
9 dbms_output.put_line('operaton success');
10 else
11 raise e_shipdate;
12 end if;
13 exception
14 when dup_val_on_index then
15 raise_application_error(-20001,'the order has already exist');
16 when e_integrity then
17 raise_application_error(-20002,'the customer does not exist');
18 when e_shipdate then
19 raise_application_error(-20003,'delivery date can not earlier than the orde
r date');
20 end;
21 /
serveroutput OFF
SQL> set serveroutput on
SQL> show serveroutput
serveroutput ON SIZE UNLIMITED FORMAT WORD_WRAPPED
operaton success
PROCEDURE ADD_ORD 出现错误:
-------- -----------------------------------------------------------------
20/3 PLS-00103: 出现符号 "end-of-file"在需要下列之一时:
; <an identifier>
<a double-quoted delimited-identifier> delete exists prior
<a single-quoted SQL string>
符号 ";" 被替换为 "end-of-file" 后继续。
--------------------------------------------------------------------------------
e_integrity exception;
e_shipdate exception;
pragma exception_init(e_integrity,-2291);
begin
if p_shipdate >= p_orddate then
insert into ord values(p_ordid,p_orddate,p_custid,p_shipdate,p_total);
dbms_output.put_line('operation success');
--------------------------------------------------------------------------------
raise e_shipdate;
end if;
exception
when dup_val_on_index then
raise_application_error(-20001,'the order has already exist');
when e_integrity then
raise_application_error(-20002,'the customer does not exist');
when e_shipdate then
raise_application_error(-20003,'delivery date can not earlier than the order dat
--------------------------------------------------------------------------------
end
SQL> select text from all_source where name='ADD_ORD';
--------------------------------------------------------------------------------
e_integrity exception;
e_shipdate exception;
pragma exception_init(e_integrity,-2291);
begin
if p_shipdate >= p_orddate then
insert into ord values(p_ordid,p_orddate,p_custid,p_shipdate,p_total);
dbms_output.put_line('operation success');
--------------------------------------------------------------------------------
raise e_shipdate;
end if;
exception
when dup_val_on_index then
raise_application_error(-20001,'the order has alreadyexist');
when e_integrity then
raise_application_error(-20002,'the customer does not exist');
when e_shipdate then
raise_application_error(-20003,'delivery date can not earlier than the order dat
--------------------------------------------------------------------------------
end
PROCEDURE';
INSERT_DEPT PROCEDURE VALID
ADD_ORD PROCEDURE INVALID
ADD_DEPT PROCEDURE INVALID
PROCEDURE';
INSERT_DEPT PROCEDURE VALID
ADD_DEPT PROCEDURE INVALID