我正在尝试调用我之前在新程序中创建的程序。无论我尝试什么,我都会在同一行出现错误。我原来的线路是:
CALL "PAYROLLDBTEST"."ABS_GetEmployeeHistoryDetail"(:EmpID)
在此我收到错误“函数或过程的名称无效:ABS_GETEMPLOYEEHISTORYDETAILS:”
然后我尝试了 CALL "PAYROLLDBTEST/ABS_GetEmployeeHistoryDetail"(EmpID) 我收到错误 "sql 语法错误:"(":" 附近的语法不正确
所以请让我知道出了什么问题。
编辑:继承人整个过程:
CREATE PROCEDURE "PAYROLLDBTEST".GetEmploymentHistoryFunction
(IN EmpID integer, IN StartDate timestamp, IN EndDate timestamp,OUT RETURNVALUE NVARCHAR)
LANGUAGE SQLSCRIPT
AS
BEGIN
SELECT *, DAYS_BETWEEN("FromDate", "ToDate") + 1 AS "DaysCount"
FROM (SELECT "Code", "Name", "U_LineID", "U_empID", "U_Status",
CASE
WHEN ("ToDate" < :StartDate) THEN NULL
WHEN ("FromDate" > :EndDate) THEN NULL
WHEN ("FromDate" < :StartDate AND ("ToDate" BETWEEN :StartDate AND :EndDate)) THEN :StartDate
WHEN ("FromDate" < :StartDate AND "ToDate" > :EndDate) THEN :StartDate
WHEN (("FromDate" BETWEEN :StartDate AND :EndDate) AND
("ToDate" BETWEEN :StartDate AND :EndDate)) THEN "FromDate"
WHEN (("FromDate" BETWEEN :StartDate AND :EndDate) AND "ToDate" > :EndDate) THEN "FromDate"
WHEN ("ToDate" IS NULL AND "FromDate" < :StartDate) THEN :StartDate
WHEN ("ToDate" IS NULL AND ("FromDate" BETWEEN :StartDate AND :EndDate)) THEN "FromDate"
END AS "FromDate",
CASE
WHEN ("ToDate" < :StartDate) THEN NULL
WHEN ("FromDate" > :EndDate) THEN NULL
WHEN ("FromDate" < :StartDate AND ("ToDate" BETWEEN :StartDate AND :EndDate)) THEN "ToDate"
WHEN (("FromDate" BETWEEN :StartDate AND :EndDate) AND
("ToDate" BETWEEN :StartDate AND :EndDate)) THEN "ToDate"
WHEN ("FromDate" < :StartDate AND "ToDate" > :EndDate) THEN :EndDate
WHEN (("FromDate" BETWEEN :StartDate AND :EndDate) AND "ToDate" > :EndDate) THEN :EndDate
WHEN ("ToDate" IS NULL AND "FromDate" < :StartDate) THEN :EndDate
WHEN ("ToDate" IS NULL AND ("FromDate" BETWEEN :StartDate AND :EndDate)) THEN :EndDate
END AS "ToDate", "U_Position", "U_Project", "U_Sponsorship"
FROM (
--select * from ABS_GetEmployeeHistoryDetails WHERE ("EmpID" IN (:EmpID))
--select * from "PAYROLLDBTEST"."ABS_GetEmployeeHistoryDetails" WHERE ("EmpID" IN (:EmpID))
CALL "PAYROLLDBTEST"."ABS_GetEmployeeHistoryDetails"(:EmpID,:RETURNVALUE);
) InnerQuery
) OuterQuery
WHERE ("FromDate" between :StartDate and :EndDate OR "ToDate" between :StartDate and :EndDate);
END;
谢谢