パッケージ
create or replace package PKG_PROJECT AS
type cur IS REF CURSOR;
procedure SP_PREPARESALARY(v_yr in number,v_mn in number);
END PKG_PROJECT;
パッケージボディ
29行目で無視されるPL/SQL文(関連する挿入クエリの直前)
create or replace package body PKG_PROJECT AS
procedure SP_PREPARESALARY(v_yr in number,v_mn in number) AS
V_EMPNO INTEGER;
V_EMPNAME VARCHAR2(30);
V_BASICSALARY INTEGER;
V_DAYSPRESENT INTEGER;
V_YEAR INTEGER;
V_MONTH INTEGER;
V_PF INTEGER;
V_TAX INTEGER;
V_MON_SAL INTEGER;
V_NET_SAL INTEGER;
V_MAXDAYS INTEGER;
CURSOR EMP_VALUES IS
SELECT EMPNO, EMPNAME, BASICSALARY, YEAR, MONTH, DAYSPRESENT
FROM DELL_EMPLOYEE, DELL_ATTENDANCE
WHERE EMPNO=ENO AND YEAR = V_YR AND MONTH = V_MN;
BEGIN
OPEN EMP_VALUES;
LOOP
FETCH EMP_VALUES INTO V_EMPNO,V_EMPNAME,V_BASICSALARY,V_YEAR,V_MONTH,V_DAYSPRESENT;
EXIT WHEN EMP_VALUES%NOTFOUND;
V_YEAR := V_YR;
V_MONTH := V_MN;
V_MAXDAYS := FN_GETMAXDAYS(V_YEAR,V_MONTH);
V_MON_SAL:= FN_GETGROSSMONTHLYSALARY(V_BASICSALARY, V_DAYSPRESENT, V_MAXDAYS);
V_PF:= FN_GETPF(V_MON_SAL);
V_TAX:= FN_GETTAX(V_MON_SAL,V_PF);
V_NET_SAL:= FN_GETNETSALARY(V_MON_SAL, V_PF, V_TAX);
INSERT INTO DELL_SALARY (EMPNO, YEAR,MONTH,EMPNAME,DAYSPRESENT,BASICSALARY,MONTHSALARY,PF,TAX,NETSALARY)
VALUES (V_EMPNO,V_YEAR,V_MONTH,V_EMPNAME,V_DAYSPRESENT,V_BASICSALARY,V_MON_SAL,
V_PF,V_TAX, V_NET_SAL);
END LOOP;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
UPDATE DELL_SALARY
SET EMPNAME=V_EMPNAME,DAYSPRESENT=V_DAYSPRESENT,BASICSALARY=V_BASICSALARY,
MONTHSALARY=V_MON_SAL,PF=V_PF,TAX=V_TAX,NETSALARY=V_NET_SAL
WHERE EMPNO=V_EMPNO AND YEAR=V_YEAR AND MONTH=V_MONTH;
END SP_PREPARESALARY;
END PKG_PROJECT;
DELL_EMPLOYEE、DELL_ATTENDANCE、DELL_SALARYテーブルを作成しました。しかし、なぜkeppが不要なエラーを取得しているのかわかりません。