CREATE OR REPLACE PROCEDURE work_attendance_result
(
Work_Place_F varchar2 -- 工作地点
,Year varchar2 -- 年度
,Month varchar2 -- 月份
,Employee_ID varchar2 -- 员工ID
,Employee_Name varchar2 -- 员工姓名
)
AS
V_Employee_ID char;
V_Employee_Name char;
V_Work_Place_F char;
V_Month_Standard_Workday INTEGER;
V_Month_Standard_Workhour INTEGER;
V_Work_M_Hrs INTEGER;
V_Work_R_Hrs INTEGER;
V_Overtime_Hrs INTEGER;
V_Evening_Hrs INTEGER;
V_Work_Detail VARCHAR2(300);
V_Night_Hrs INTEGER;
V_Overnight_Detail VARCHAR2(300);
V_Weekends_Holiday_Hrs INTEGER;
V_Weekends_Holiday_Info NVARCHAR2(1000);
V_Overtime_Free_Hour INTEGER;
V_Rostered_Dayoff_Days NVARCHAR2(1000);
V_M_Annual_Leave_Days INTEGER;
V_M_Annual_Leave_Info NVARCHAR2(1000);
V_Leave_Days INTEGER;
V_Leave_Info NVARCHAR2(1000);
V_CL_LE_Times INTEGER;
V_CL_LE_Info NVARCHAR2(1000);
V_Rostered_Dayoff_Detail INTEGER;
V_Work_Days_R INTEGER;
V_Work_Overtime_Days INTEGER;
V_LY_AL INTEGER;
V_LY_AL_Taken INTEGER;
V_LY_Al_Info NVARCHAR2(1000);
V_LY_AL_Residual INTEGER;
V_Y_AL INTEGER;
V_Y_AL_Taken INTEGER;
V_Y_Al_Info NVARCHAR2(1000);
V_Y_AL_Residual INTEGER;
V_Trans_fee DECIMAL(6,2);
V_Food_fee DECIMAL(6,2);
V_Overtime_fee DECIMAL(6,2);
V_Late_Deduct_fee DECIMAL(6,2);
V_Absent_Deduct_fee DECIMAL(6,2);
BEGIN
SELECT
kt2.Employee_ID Employee_ID -- 员工ID
,MAX(et1.Employee_Name) Employee_Name -- 姓名
,kt2.Work_Place Work_Place -- 工作地点
,MAX(kt2.Month_Standard_Workday) Month_Standard_Workday -- 月标准工作天数
,MAX(kt2.Month_Standard_Workhour) Month_Standard_Workhour -- 月标准工时
,MAX(kt2.Work_M_Hrs) Work_M_Hrs -- 月工时
,MAX(kt2.Work_R_Hrs) Work_R_Hrs -- 正常工时
,MAX(kt2.Overtime_Hrs) Overtime_Hrs -- 加班工时
,MAX(kt2.Evening_Hrs) Evening_Hrs -- 晚间加班小时
,MAX(kt2.Work_Detail) Work_Detail -- 晚加班明细
,MAX(kt2.Night_Hrs) Night_Hrs -- 通宵加班小时
,MAX(kt2.Overnight_Detail) Overnight_Detail -- 通宵加班明细
,MAX(kt2.Weekends_Holiday_Hrs) Weekends_Holiday_Hrs -- 周末节假日加班小时
,MAX(kt2.Weekends_Holiday_Info) Weekends_Holiday_Info -- 周末节假日加班明细
,MAX(kt2.Overtime_Free_Hour) Overtime_Free_Hour -- 串休小时
,MAX(kt2.Rostered_Dayoff_Days) Rostered_Dayoff_Days -- 串休明细
,MAX(kt2.M_Annual_Leave_Days) M_Annual_Leave_Days -- 本月休年假(天)
,MAX(kt2.M_Annual_Leave_Info) M_Annual_Leave_Info -- 本月休年假明细
,MAX(kt2.Leave_Days) Leave_Days -- 请假(天)
,MAX(kt2.Leave_Info) Leave_Info -- 请假明细
,MAX(kt2.CL_LE_Times) CL_LE_Times -- 迟到早退(次)
,MAX(kt2.CL_LE_Info) CL_LE_Info -- 迟到早退明细
,MAX(kt2.Rostered_Dayoff_Detail) Rostered_Dayoff_Detail -- 加班—串休剩余(天)
,MAX(kt2.Work_Days_R) Work_Days_R -- 正常工作(天)
,MAX(kt2.Work_Overtime_Days) Work_Overtime_Days -- 工作及加班累计(天)
,MAX(kt3.LY_AL) LY_AL -- 上年年假(天)
,MAX(kt3.LY_AL_Taken) LY_AL_Taken -- 上年已休年假(天)
,MAX(kt3.LY_Al_Info) LY_Al_Info -- 上年休年假明细
,MAX(kt3.LY_AL_Residual) LY_AL_Residual -- 上年剩余年假(天)
,MAX(kt3.Y_AL) Y_AL -- 本年年假(天)
,MAX(kt3.Y_AL_Taken) Y_AL_Taken -- 本年已休年假(天)
,MAX(kt3.Y_Al_Info) Y_Al_Info -- 本年休年假明细
,MAX(kt3.Y_AL_Residual) Y_AL_Residual -- 本年剩余年假(天)
,MAX(kt2.Trans_fee) Trans_fee -- 车补(元)
,MAX(kt2.Food_fee) Food_fee -- 餐补(元)
,MAX(kt2.Overtime_fee) Overtime_fee -- 加班费用(元)
,MAX(kt2.Late_Deduct_fee) Late_Deduct_fee -- 迟到扣除(元)
,MAX(kt2.Absent_Deduct_fee) Absent_Deduct_fee -- 旷工扣除(元)
INTO
V_Employee_ID
,V_Employee_Name
,V_Work_Place_F
,V_Month_Standard_Workday
,V_Month_Standard_Workhour
,V_Work_M_Hrs
,V_Work_R_Hrs
,V_Overtime_Hrs
,V_Evening_Hrs
,V_Work_Detail
,V_Night_Hrs
,V_Overnight_Detail
,V_Weekends_Holiday_Hrs
,V_Weekends_Holiday_Info
,V_Overtime_Free_Hour
,V_Rostered_Dayoff_Days
,V_M_Annual_Leave_Days
,V_M_Annual_Leave_Info
,V_Leave_Days
,V_Leave_Info
,V_CL_LE_Times
,V_CL_LE_Info
,V_Rostered_Dayoff_Detail
,V_Work_Days_R
,V_Work_Overtime_Days
,V_LY_AL
,V_LY_AL_Taken
,V_LY_Al_Info
,V_LY_AL_Residual
,V_Y_AL
,V_Y_AL_Taken
,V_Y_Al_Info
,V_Y_AL_Residual
,V_Trans_fee
,V_Food_fee
,V_Overtime_fee
,V_Late_Deduct_fee
,V_Absent_Deduct_fee
FROM
KT100200 kt2
INNER JOIN ET100100 et1 ON et1.Employee_No = kt2.Employee_ID
INNER JOIN KT100100 kt1 ON kt2.Employee_ID = kt1.Employee_ID AND kt2.Year = kt1.Year AND kt2.Month = kt1.Month
INNER JOIN KT100300 kt3 ON kt2.Employee_ID = kt3.Employee_ID AND kt2.Year = kt3.Year
WHERE
kt2.Employee_ID IN
(
SELECT DISTINCT
Kt1.Employee_ID
FROM
KT100100 Kt1
WHERE
(Work_Place_F IS NULL OR nvl(Kt1.Work_Place_F, '') = Work_Place_F)
)
AND (Year IS NULL OR nvl(kt2.Year, '') = Year)
AND (Month IS NULL OR nvl(kt2.Month, '') = Month)
AND (Employee_ID IS NULL OR nvl(kt2.Employee_ID, '') = Employee_ID)
AND (Employee_Name IS NULL OR nvl(et1.Employee_Name, '') = Employee_Name)
GROUP BY
kt2.Employee_ID
,kt2.Year
,kt2.Month
,kt2.Work_Place;
EXCEPTION
WHEN NO_DATA_FOUND THEN dbms_output.put_line('没有记录');
WHEN VALUE_ERROR THEN dbms_output.put_line('变量赋值错误');
WHEN TOO_MANY_ROWS THEN dbms_output.put_line('查询有多行记录');《--这里报错
WHEN OTHERS THEN dbms_output.put_line('error');
END;
4 个解决方案
#1
游标就是对付多行的
#2
怎么样解决啊!
来个例子行吗?
来个例子行吗?
#3
CREATE OR REPLACE PROCEDURE work_attendance_result
(
Work_Place_F varchar2 -- 工作地点
,Year varchar2 -- 年度
,Month varchar2 -- 月份
,Employee_ID varchar2 -- 员工ID
,Employee_Name varchar2 -- 员工姓名
)
AS
V_Employee_ID char;
V_Employee_Name char;
V_Work_Place_F char;
V_Month_Standard_Workday INTEGER;
V_Month_Standard_Workhour INTEGER;
V_Work_M_Hrs INTEGER;
V_Work_R_Hrs INTEGER;
V_Overtime_Hrs INTEGER;
V_Evening_Hrs INTEGER;
V_Work_Detail VARCHAR2(300);
V_Night_Hrs INTEGER;
V_Overnight_Detail VARCHAR2(300);
V_Weekends_Holiday_Hrs INTEGER;
V_Weekends_Holiday_Info NVARCHAR2(1000);
V_Overtime_Free_Hour INTEGER;
V_Rostered_Dayoff_Days NVARCHAR2(1000);
V_M_Annual_Leave_Days INTEGER;
V_M_Annual_Leave_Info NVARCHAR2(1000);
V_Leave_Days INTEGER;
V_Leave_Info NVARCHAR2(1000);
V_CL_LE_Times INTEGER;
V_CL_LE_Info NVARCHAR2(1000);
V_Rostered_Dayoff_Detail INTEGER;
V_Work_Days_R INTEGER;
V_Work_Overtime_Days INTEGER;
V_LY_AL INTEGER;
V_LY_AL_Taken INTEGER;
V_LY_Al_Info NVARCHAR2(1000);
V_LY_AL_Residual INTEGER;
V_Y_AL INTEGER;
V_Y_AL_Taken INTEGER;
V_Y_Al_Info NVARCHAR2(1000);
V_Y_AL_Residual INTEGER;
V_Trans_fee DECIMAL(6,2);
V_Food_fee DECIMAL(6,2);
V_Overtime_fee DECIMAL(6,2);
V_Late_Deduct_fee DECIMAL(6,2);
V_Absent_Deduct_fee DECIMAL(6,2);
cursor cur_a as
SELECT
kt2.Employee_ID Employee_ID -- 员工ID
,MAX(et1.Employee_Name) Employee_Name -- 姓名
,kt2.Work_Place Work_Place -- 工作地点
,MAX(kt2.Month_Standard_Workday) Month_Standard_Workday -- 月标准工作天数
,MAX(kt2.Month_Standard_Workhour) Month_Standard_Workhour -- 月标准工时
,MAX(kt2.Work_M_Hrs) Work_M_Hrs -- 月工时
,MAX(kt2.Work_R_Hrs) Work_R_Hrs -- 正常工时
,MAX(kt2.Overtime_Hrs) Overtime_Hrs -- 加班工时
,MAX(kt2.Evening_Hrs) Evening_Hrs -- 晚间加班小时
,MAX(kt2.Work_Detail) Work_Detail -- 晚加班明细
,MAX(kt2.Night_Hrs) Night_Hrs -- 通宵加班小时
,MAX(kt2.Overnight_Detail) Overnight_Detail -- 通宵加班明细
,MAX(kt2.Weekends_Holiday_Hrs) Weekends_Holiday_Hrs -- 周末节假日加班小时
,MAX(kt2.Weekends_Holiday_Info) Weekends_Holiday_Info -- 周末节假日加班明细
,MAX(kt2.Overtime_Free_Hour) Overtime_Free_Hour -- 串休小时
,MAX(kt2.Rostered_Dayoff_Days) Rostered_Dayoff_Days -- 串休明细
,MAX(kt2.M_Annual_Leave_Days) M_Annual_Leave_Days -- 本月休年假(天)
,MAX(kt2.M_Annual_Leave_Info) M_Annual_Leave_Info -- 本月休年假明细
,MAX(kt2.Leave_Days) Leave_Days -- 请假(天)
,MAX(kt2.Leave_Info) Leave_Info -- 请假明细
,MAX(kt2.CL_LE_Times) CL_LE_Times -- 迟到早退(次)
,MAX(kt2.CL_LE_Info) CL_LE_Info -- 迟到早退明细
,MAX(kt2.Rostered_Dayoff_Detail) Rostered_Dayoff_Detail -- 加班—串休剩余(天)
,MAX(kt2.Work_Days_R) Work_Days_R -- 正常工作(天)
,MAX(kt2.Work_Overtime_Days) Work_Overtime_Days -- 工作及加班累计(天)
,MAX(kt3.LY_AL) LY_AL -- 上年年假(天)
,MAX(kt3.LY_AL_Taken) LY_AL_Taken -- 上年已休年假(天)
,MAX(kt3.LY_Al_Info) LY_Al_Info -- 上年休年假明细
,MAX(kt3.LY_AL_Residual) LY_AL_Residual -- 上年剩余年假(天)
,MAX(kt3.Y_AL) Y_AL -- 本年年假(天)
,MAX(kt3.Y_AL_Taken) Y_AL_Taken -- 本年已休年假(天)
,MAX(kt3.Y_Al_Info) Y_Al_Info -- 本年休年假明细
,MAX(kt3.Y_AL_Residual) Y_AL_Residual -- 本年剩余年假(天)
,MAX(kt2.Trans_fee) Trans_fee -- 车补(元)
,MAX(kt2.Food_fee) Food_fee -- 餐补(元)
,MAX(kt2.Overtime_fee) Overtime_fee -- 加班费用(元)
,MAX(kt2.Late_Deduct_fee) Late_Deduct_fee -- 迟到扣除(元)
,MAX(kt2.Absent_Deduct_fee) Absent_Deduct_fee -- 旷工扣除(元)
FROM
KT100200 kt2
INNER JOIN ET100100 et1 ON et1.Employee_No = kt2.Employee_ID
INNER JOIN KT100100 kt1 ON kt2.Employee_ID = kt1.Employee_ID AND kt2.Year = kt1.Year AND kt2.Month = kt1.Month
INNER JOIN KT100300 kt3 ON kt2.Employee_ID = kt3.Employee_ID AND kt2.Year = kt3.Year
WHERE
kt2.Employee_ID IN
(
SELECT DISTINCT
Kt1.Employee_ID
FROM
KT100100 Kt1
WHERE
(Work_Place_F IS NULL OR nvl(Kt1.Work_Place_F, '') = Work_Place_F)
)
AND (Year IS NULL OR nvl(kt2.Year, '') = Year)
AND (Month IS NULL OR nvl(kt2.Month, '') = Month)
AND (Employee_ID IS NULL OR nvl(kt2.Employee_ID, '') = Employee_ID)
AND (Employee_Name IS NULL OR nvl(et1.Employee_Name, '') = Employee_Name)
GROUP BY
kt2.Employee_ID
,kt2.Year
,kt2.Month
,kt2.Work_Place;
BEGIN
open cur_a
loop
feach cur_a
INTO
V_Employee_ID
,V_Employee_Name
,V_Work_Place_F
,V_Month_Standard_Workday
,V_Month_Standard_Workhour
,V_Work_M_Hrs
,V_Work_R_Hrs
,V_Overtime_Hrs
,V_Evening_Hrs
,V_Work_Detail
,V_Night_Hrs
,V_Overnight_Detail
,V_Weekends_Holiday_Hrs
,V_Weekends_Holiday_Info
,V_Overtime_Free_Hour
,V_Rostered_Dayoff_Days
,V_M_Annual_Leave_Days
,V_M_Annual_Leave_Info
,V_Leave_Days
,V_Leave_Info
,V_CL_LE_Times
,V_CL_LE_Info
,V_Rostered_Dayoff_Detail
,V_Work_Days_R
,V_Work_Overtime_Days
,V_LY_AL
,V_LY_AL_Taken
,V_LY_Al_Info
,V_LY_AL_Residual
,V_Y_AL
,V_Y_AL_Taken
,V_Y_Al_Info
,V_Y_AL_Residual
,V_Trans_fee
,V_Food_fee
,V_Overtime_fee
,V_Late_Deduct_fee
,V_Absent_Deduct_fee ;
exit when cur_a%notfound ;
end loop;
EXCEPTION
WHEN NO_DATA_FOUND THEN dbms_output.put_line('没有记录');
WHEN VALUE_ERROR THEN dbms_output.put_line('变量赋值错误');
WHEN TOO_MANY_ROWS THEN dbms_output.put_line('查询有多行记录');《--这里报错
WHEN OTHERS THEN dbms_output.put_line('error');
END;
#4
如果对取出的数据进行操作,就在exit那句下面加操作语句
#1
游标就是对付多行的
#2
怎么样解决啊!
来个例子行吗?
来个例子行吗?
#3
CREATE OR REPLACE PROCEDURE work_attendance_result
(
Work_Place_F varchar2 -- 工作地点
,Year varchar2 -- 年度
,Month varchar2 -- 月份
,Employee_ID varchar2 -- 员工ID
,Employee_Name varchar2 -- 员工姓名
)
AS
V_Employee_ID char;
V_Employee_Name char;
V_Work_Place_F char;
V_Month_Standard_Workday INTEGER;
V_Month_Standard_Workhour INTEGER;
V_Work_M_Hrs INTEGER;
V_Work_R_Hrs INTEGER;
V_Overtime_Hrs INTEGER;
V_Evening_Hrs INTEGER;
V_Work_Detail VARCHAR2(300);
V_Night_Hrs INTEGER;
V_Overnight_Detail VARCHAR2(300);
V_Weekends_Holiday_Hrs INTEGER;
V_Weekends_Holiday_Info NVARCHAR2(1000);
V_Overtime_Free_Hour INTEGER;
V_Rostered_Dayoff_Days NVARCHAR2(1000);
V_M_Annual_Leave_Days INTEGER;
V_M_Annual_Leave_Info NVARCHAR2(1000);
V_Leave_Days INTEGER;
V_Leave_Info NVARCHAR2(1000);
V_CL_LE_Times INTEGER;
V_CL_LE_Info NVARCHAR2(1000);
V_Rostered_Dayoff_Detail INTEGER;
V_Work_Days_R INTEGER;
V_Work_Overtime_Days INTEGER;
V_LY_AL INTEGER;
V_LY_AL_Taken INTEGER;
V_LY_Al_Info NVARCHAR2(1000);
V_LY_AL_Residual INTEGER;
V_Y_AL INTEGER;
V_Y_AL_Taken INTEGER;
V_Y_Al_Info NVARCHAR2(1000);
V_Y_AL_Residual INTEGER;
V_Trans_fee DECIMAL(6,2);
V_Food_fee DECIMAL(6,2);
V_Overtime_fee DECIMAL(6,2);
V_Late_Deduct_fee DECIMAL(6,2);
V_Absent_Deduct_fee DECIMAL(6,2);
cursor cur_a as
SELECT
kt2.Employee_ID Employee_ID -- 员工ID
,MAX(et1.Employee_Name) Employee_Name -- 姓名
,kt2.Work_Place Work_Place -- 工作地点
,MAX(kt2.Month_Standard_Workday) Month_Standard_Workday -- 月标准工作天数
,MAX(kt2.Month_Standard_Workhour) Month_Standard_Workhour -- 月标准工时
,MAX(kt2.Work_M_Hrs) Work_M_Hrs -- 月工时
,MAX(kt2.Work_R_Hrs) Work_R_Hrs -- 正常工时
,MAX(kt2.Overtime_Hrs) Overtime_Hrs -- 加班工时
,MAX(kt2.Evening_Hrs) Evening_Hrs -- 晚间加班小时
,MAX(kt2.Work_Detail) Work_Detail -- 晚加班明细
,MAX(kt2.Night_Hrs) Night_Hrs -- 通宵加班小时
,MAX(kt2.Overnight_Detail) Overnight_Detail -- 通宵加班明细
,MAX(kt2.Weekends_Holiday_Hrs) Weekends_Holiday_Hrs -- 周末节假日加班小时
,MAX(kt2.Weekends_Holiday_Info) Weekends_Holiday_Info -- 周末节假日加班明细
,MAX(kt2.Overtime_Free_Hour) Overtime_Free_Hour -- 串休小时
,MAX(kt2.Rostered_Dayoff_Days) Rostered_Dayoff_Days -- 串休明细
,MAX(kt2.M_Annual_Leave_Days) M_Annual_Leave_Days -- 本月休年假(天)
,MAX(kt2.M_Annual_Leave_Info) M_Annual_Leave_Info -- 本月休年假明细
,MAX(kt2.Leave_Days) Leave_Days -- 请假(天)
,MAX(kt2.Leave_Info) Leave_Info -- 请假明细
,MAX(kt2.CL_LE_Times) CL_LE_Times -- 迟到早退(次)
,MAX(kt2.CL_LE_Info) CL_LE_Info -- 迟到早退明细
,MAX(kt2.Rostered_Dayoff_Detail) Rostered_Dayoff_Detail -- 加班—串休剩余(天)
,MAX(kt2.Work_Days_R) Work_Days_R -- 正常工作(天)
,MAX(kt2.Work_Overtime_Days) Work_Overtime_Days -- 工作及加班累计(天)
,MAX(kt3.LY_AL) LY_AL -- 上年年假(天)
,MAX(kt3.LY_AL_Taken) LY_AL_Taken -- 上年已休年假(天)
,MAX(kt3.LY_Al_Info) LY_Al_Info -- 上年休年假明细
,MAX(kt3.LY_AL_Residual) LY_AL_Residual -- 上年剩余年假(天)
,MAX(kt3.Y_AL) Y_AL -- 本年年假(天)
,MAX(kt3.Y_AL_Taken) Y_AL_Taken -- 本年已休年假(天)
,MAX(kt3.Y_Al_Info) Y_Al_Info -- 本年休年假明细
,MAX(kt3.Y_AL_Residual) Y_AL_Residual -- 本年剩余年假(天)
,MAX(kt2.Trans_fee) Trans_fee -- 车补(元)
,MAX(kt2.Food_fee) Food_fee -- 餐补(元)
,MAX(kt2.Overtime_fee) Overtime_fee -- 加班费用(元)
,MAX(kt2.Late_Deduct_fee) Late_Deduct_fee -- 迟到扣除(元)
,MAX(kt2.Absent_Deduct_fee) Absent_Deduct_fee -- 旷工扣除(元)
FROM
KT100200 kt2
INNER JOIN ET100100 et1 ON et1.Employee_No = kt2.Employee_ID
INNER JOIN KT100100 kt1 ON kt2.Employee_ID = kt1.Employee_ID AND kt2.Year = kt1.Year AND kt2.Month = kt1.Month
INNER JOIN KT100300 kt3 ON kt2.Employee_ID = kt3.Employee_ID AND kt2.Year = kt3.Year
WHERE
kt2.Employee_ID IN
(
SELECT DISTINCT
Kt1.Employee_ID
FROM
KT100100 Kt1
WHERE
(Work_Place_F IS NULL OR nvl(Kt1.Work_Place_F, '') = Work_Place_F)
)
AND (Year IS NULL OR nvl(kt2.Year, '') = Year)
AND (Month IS NULL OR nvl(kt2.Month, '') = Month)
AND (Employee_ID IS NULL OR nvl(kt2.Employee_ID, '') = Employee_ID)
AND (Employee_Name IS NULL OR nvl(et1.Employee_Name, '') = Employee_Name)
GROUP BY
kt2.Employee_ID
,kt2.Year
,kt2.Month
,kt2.Work_Place;
BEGIN
open cur_a
loop
feach cur_a
INTO
V_Employee_ID
,V_Employee_Name
,V_Work_Place_F
,V_Month_Standard_Workday
,V_Month_Standard_Workhour
,V_Work_M_Hrs
,V_Work_R_Hrs
,V_Overtime_Hrs
,V_Evening_Hrs
,V_Work_Detail
,V_Night_Hrs
,V_Overnight_Detail
,V_Weekends_Holiday_Hrs
,V_Weekends_Holiday_Info
,V_Overtime_Free_Hour
,V_Rostered_Dayoff_Days
,V_M_Annual_Leave_Days
,V_M_Annual_Leave_Info
,V_Leave_Days
,V_Leave_Info
,V_CL_LE_Times
,V_CL_LE_Info
,V_Rostered_Dayoff_Detail
,V_Work_Days_R
,V_Work_Overtime_Days
,V_LY_AL
,V_LY_AL_Taken
,V_LY_Al_Info
,V_LY_AL_Residual
,V_Y_AL
,V_Y_AL_Taken
,V_Y_Al_Info
,V_Y_AL_Residual
,V_Trans_fee
,V_Food_fee
,V_Overtime_fee
,V_Late_Deduct_fee
,V_Absent_Deduct_fee ;
exit when cur_a%notfound ;
end loop;
EXCEPTION
WHEN NO_DATA_FOUND THEN dbms_output.put_line('没有记录');
WHEN VALUE_ERROR THEN dbms_output.put_line('变量赋值错误');
WHEN TOO_MANY_ROWS THEN dbms_output.put_line('查询有多行记录');《--这里报错
WHEN OTHERS THEN dbms_output.put_line('error');
END;
#4
如果对取出的数据进行操作,就在exit那句下面加操作语句