我是HANA Studio的新人,请原谅。
在 SAP HANA Studio 中创建函数时出现错误。这是我的功能:
CREATE FUNCTION "PAYROLLDBTEST".GetAbsenteeismDays
(
-- Add the parameters for the function here
EmpID integer,
StartDate Datetime,
EndDate Datetime
)
RETURNS AbsDays float
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
AbsDays float;
BEGIN
(SELECT SUM(DATEDIFF(DAY, "fromDate", "toDate") + 1) AS AbsentDays into AbsDays
FROM HEM1
WHERE "empID" = :EmpID AND "fromDate" BETWEEN :StartDate AND :EndDate
AND "toDate" BETWEEN :StartDate AND :EndDate
);
RETURNS AbsDays;
错误 :
“无法在 2 ms 807 µs 内执行‘CREATE FUNCTION‘PAYROLLDBTEST’.GetAbsenteeismDays (--在此处添加函数的参数 ...’。SAP DBTech JDBC: [257] (at 576): sql 语法错误: 语法不正确“返回”附近:第 23 列第 1 行(在 pos 576)“