This is my full code:
CREATE PROCEDURE "PAYROLLDBTEST".GetWorkingDays
(
-- Add the parameters for the function here
IN EmpID integer,
IN StartDate Datetime,
IN EndDate Datetime
)
--RETURNS float
LANGUAGE SQLSCRIPT
AS
BEGIN
-- Declare the return variable here
DECLARE WorkingDays float;
DECLARE AbsenteeismDays float;
DECLARE TakenUnpaidLeaves float;
DECLARE DaysDifference float;
DECLARE HourlyDeductions float;
CALL "PAYROLLDBTEST".ABS_GetDaysDifference(:EmpID, :EndDate, :WorkingDays,DaysDifference);
here i am calling another procedure in select command. But it's giving me error that invalid function/procedure name.
SET @WorkingDays =
(select SUM(DaysCount) AS DaysCount from dbo.GetEmploymentHistoryFunction (@EmpID, @StartDate, @EndDate)
where U_Status IN (1,4))
AbsenteeismDays := CALL "PAYROLLDBTEST".GetAbsenteeismDays (:EmpID, :StartDate, :EndDate);
CALL "PAYROLLDBTEST".GetUnpaidTakenLeaves (:EmpID, :StartDate, :EndDate,TakenUnpaidLeaves);
CALL "PAYROLLDBTEST".ABS_GetHourlyDeductions(:EmpID, :StartDate, :EndDate,HourlyDeductions);
-- Return working days after deducting absenteeism days, unpaid leave days and hourly deductions
--RETURN ISNULL(@WorkingDays,0) + @DaysDifference - @AbsenteeismDays - @TakenUnpaidLeaves - @HourlyDeductions;
IF(WorkingDays IS NULL)
THEN
WorkingDays :=0;
END IF;
RETURN WorkingDays + DaysDifference - AbsenteeismDays - TakenUnpaidLeaves - HourlyDeductions;
END;