0

i am trying to create a view by using HANA stored procedure,but unable to do. It's giving error that incorrect syntax near ".".

i want to create view by using HANA stored procedure,but unable to do. It's giving error that incorrect syntax near ".".
At

call "PAYROLLDBTEST".GetEmpCodeFromEmployeeID(EmpID,EmpCode) AS "EmpCode"

Here is my code :

CREATE VIEW "@HourTransactionView" AS SELECT "@TRANSACTION_HOURS"."DocEntry","@TRANSACTION_HOURS"."DocNum",
"@TRANSACTION_HOURS"."U_EmpCode" AS "EmpID",
call "PAYROLLDBTEST".GetEmpCodeFromEmployeeID(EmpID,EmpCode) AS "EmpCode" ,
GetEmployeeFullName("@TRANSACTION_HOURS"."U_EmpCode") AS "FullName", "U_TransactionType" AS "TranCode",
GetHourTableName("U_TransactionType") AS "TableName", GetHourTransactionName("U_TransactionType") AS "TranName",
"U_FromDate", "U_ToDate", DAYS_BETWEEN("U_FromDate", "U_ToDate") + 1 AS "NoOfDays", "U_FromTime", "U_ToTime",
IFNULL("U_WorkHours", 0) AS "NoOfHours", IFNULL("U_OvertimeHours", 0) AS "OvertimeHours",
IFNULL("U_PaidDays", 0) AS "PaidDays", IFNULL("U_UnpaidDays", 0) AS "UnpaidDays",
IFNULL("U_WeekendsCount", 0) AS "Weekends", IFNULL("U_HolidaysCount", 0) AS "Holidays", "U_Remarks", "U_BatchNo",
"U_ProjectCode" AS "ProjectCode"
FROM "@TRANSACTION_HOURS"
INNER JOIN OHEM ON OHEM."empID" = "@TRANSACTION_HOURS"."U_EmpCode";

Please help me to find solution. Thank You.

4

2 回答 2

1

参考 Hana SQL 参考,您不能在 select 语句中使用过程调用。

http://help.sap.com/saphelp_hanaplatform/helpdata/en/20/fcf24075191014a89e9dc7b8408b26/content.htm

于 2014-07-28T12:48:19.830 回答
0

也许您可以尝试将过程“PAYROLLDBTEST”.GetEmpCodeFromEmployeeID 包装成一个函数。这可以使用 procview 来完成。

CREATE PROCEDURE GetEmpCodeFromEmployeeID(...)
LANGUAGE SQLSCRIPT
READS SQL DATA WITH RESULT VIEW ProcView AS
BEGIN
 ...
END;

Create Function GetEmpCodeFromEmployeeIDFunc(...)
 Begin
  return Select * from ProcView;
 End;

参考:https ://help.sap.com/saphelp_hanaplatform/helpdata/en/20/d467407519101484f190f545d54b24/content.htm

于 2016-06-19T17:39:16.933 回答