on 06-06-2014 11:05 AM
Hi,
I am trying to convert SQL function in HANA Studio. But whenever I execute it gives error "Scalar UDF does not support SQL statement"
Function is :
CREATE FUNCTION "PAYROLLDBTEST".ABS_GetEmployeeHistoryDetails ( EmpID integer)
RETURNS TABLE NVARCHAR(100)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
BEGIN SELECT "Code", "Name", "U_LineID", "U_empID", "U_Status", "U_Date" AS "FromDate", ADD_DAYS(
(SELECT TOP 1 history."U_Date" AS "ToDate"
FROM "@EMP_HISTORY" history
WHERE history."U_Date" > "@EMP_HISTORY"."U_Date" AND history."U_empID" = "@EMP_HISTORY"."U_empID"
ORDER BY history."U_Date"), -1) AS "ToDate", "U_Position", "U_Project", "U_Sponsorship"
FROM "@EMP_HISTORY"
WHERE "U_empID" = :EmpID;
END;
I am not sure if version could be a problem. However HANA version I m using is 1.0.69
Please help, stuck for a long time.
Thanks
I also encountered the same problem..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have any actual HANA experience yet, but I suspect you need a RETURN keyword between the BEGIN and the SELECT.
-bret
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.