on 10-17-2014 11:08 AM
Hi,
I have this error "field or table alias is not allowed as an input of table functions" when try to create function on Hana Studio.
The executed code is like this:
CREATE FUNCTION "FUNCTION_2" (IN strYYYYMMDD_Da NVARCHAR(8), IN strYYYYMMDD_A NVARCHAR(8))
RETURNS TABLE ("DATE_SAP" VARCHAR(8)
, "HOUR" VARCHAR(2)
, "MINUTE" VARCHAR(2)
, "DocEntry SMALLINT")
LANGUAGE SQLSCRIPT AS
BEGIN
RETURN SELECT "T1"."DATE_SAP"
, "T1"."HOUR"
, "T1"."MINUTE"
, "T0"."DocEntry"
FROM "@MY_UDO_DOC" "T0"
INNER JOIN "FUNCTION_1" (strYYYYMMDD_Da, strYYYYMMDD_A) AS "T1"
ON "T1"."DATE_SAP" = "T0"."U_myDateUdo"
WHERE ifnull("T0"."Canceled",'N') = 'N';
END
Can I create a function that call another Function?
Regards, Alessandro
Yes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, what you actually want is not simply call a function from within another function.
Instead you want to get a table returned based on the input parameters and join it with another table.
This is exactly what you would do with procedures or scripted calc views.
If you stack multiple scripted calc views then you get precisely this functionality.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.