Skip to Content
0

How to pass a input parameter from a table function to a Calculation View

Jul 11, 2017 at 01:36 PM

384

avatar image

How can I pass an input parameter from a table function to a Calculation view?

Generated SQL via HANA Studio shows that even integers are surrounded by quotes:

SELECT pos.*
FROM "_SYS_BIC"."package/POS_AND_JOBS"('PLACEHOLDER' = ('$$NUMBER_OF_CUBES$$', '10')) pos

But how to pass a parameter from a table function?

FUNCTION "SCHEMA"."package::JoinSegmentAndPorfolio" ( numberOfCubes tinyint ) 
RETURNS table (
"JobId" varchar(36)
)
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER AS
BEGIN
return
SELECT "JobId"
FROM "_SYS_BIC"."package/POS_AND_JOBS"('PLACEHOLDER' = ('$NUMBER_OF_CUBES$', '':numberOfCubes'')) pos;
END;

I tried it with one, two and three single quotes but non of it is working.

So how do I pass an input parameter from a table function to a graphical calculation view?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Florian Pfeffer
Jul 11, 2017 at 08:02 PM
1

For me it worked always fine using the following syntax:

...
SELECT "JobId"
FROM ... ( PLACEHOLDER."$$NUMBER_OF_CUBE$$" => :numberOfCubes )

Regards,
Florian

PS:
As nearly all customers do not wanna see coding or namespaces of them in an open forum, I would anonymize the procedure name and the namespace.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thx for the solution. Where did you get the syntax from?

0