cancel
Showing results for 
Search instead for 
Did you mean: 

Create Function hana that call another function

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

Yes.

Former Member
0 Kudos

Hi Lars,

when try to create the kind function wrote before iget this error :

feature not supported: field or table alias is not allowed as an input of table functions

how i pass input value to the inner function?

Regards alessandro

lbreddemann
Active Contributor
0 Kudos

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.

shuqair_samer
Explorer
0 Kudos

Dear Lars,

can u give us an example of scripted calc views to accomplish that? can scripted calc views accept alias or table field as an input parameter? how to do that?

Thanks