以下是包 TASK5 的标题
CREATE OR REPLACE PACKAGE TASK5
AS
PROCEDURE TASK5APROCEDURE (
REG_NO IN NUMBER,
CERT_TITLE OUT VARCHAR2,
E_DATE OUT DATE,
C_MARKS OUT INTEGER);
PROCEDURE TASK5BPROCEDURE (
CERT_ID IN CHAR,
C_T OUT CHAR) ;
END TASK5;
PACKAGE TASK5 的主体
CREATE OR REPLACE PACKAGE BODY TASK5
AS
PROCEDURE TASK5APROCEDURE (
REG_NO IN NUMBER,
CERT_TITLE OUT VARCHAR2,
E_DATE OUT DATE,
C_MARKS OUT INTEGER)
IS
BEGIN
SELECT
O.PCP_TITLE,
C.CERT_EXAMDATE,
C.CERT_MARKS
INTO
CERT_TITLE,
E_DATE,
C_MARKS
FROM
PROFCERTPROGRAM O
INNER JOIN
CERTIFICATION C
ON O.PCP_ID = C.PCP_ID
WHERE
C.S_REGNO LIKE REG_NO;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
END TASK5APROCEDURE;
PROCEDURE TASK5BPROCEDURE (
CERT_ID IN CHAR, C_T OUT CHAR)
IS
BEGIN
DBMS_OUTPUT.PUT_LINE ('COURSE NAMES: ');
FOR R IN (
SELECT O.C_TITLE C_T
FROM
COURSE O
INNER JOIN
CERTIFICATIONREQUIREMENT C
ON O.C_ID = C.C_ID
WHERE
C.PCP_ID LIKE '%'||CERT_ID||'%')
LOOP
DBMS_OUTPUT.PUT_LINE (R.C_T);
END LOOP ;
END TASK5BPROCEDURE;
END TASK5;
我为两个不同的输入编写了两个不同的程序包。但是,我想用重载过程重写标题和正文,有什么建议吗?