Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: how to use procedure in select query in HANA.

$
0
0

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;


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>