文档版本:
Oracle® Database PL/SQL User's Guide and Reference
10g Release 2 (10.2)
Part Number B14261-01
文档范例如下:
Example 8-9 Restrictions on Overloading PL/SQL Procedures
DECLARE
PROCEDURE balance (acct_no IN INTEGER) IS
BEGIN NULL; END;
PROCEDURE balance (acct_no OUT INTEGER) IS
BEGIN NULL; END;
BEGIN
DBMS_OUTPUT.PUT_LINE('The following procedure call raises an error.');
-- balance(100); raises an error because the procedure declaration is not unique
END;
/
其实我在测试的时候,发现是可以的。 如下:
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Connected as xxxx
SQL>
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 PROCEDURE balance (acct_no IN INTEGER) IS
3 BEGIN NULL; END;
4 PROCEDURE balance (acct_no OUT INTEGER) IS
5 BEGIN NULL; END;
6 BEGIN
7 DBMS_OUTPUT.PUT_LINE('The following procedure call raises an error.');
8 -- balance(100); raises an error because the procedure declaration is not unique
9 END;
10 /
The following procedure call raises an error.
PL/SQL procedure successfully completed
SQL>