Skip to Content
1
Former Member
Apr 10, 2012 at 04:01 PM

How to call a procedure in HANA

20374 Views

I created a very simple procedure under my Schema. The procedure that selects one field from my HANA analytical view and sends it to the the output (which is a table with one field in it). The procedure saved and activated without issues. I am now trying to call my procedure from SQL editor and keep getting syntax errors around the call statement and the parameters passed.

Here's what I tried:

I defined my procedure as "NAME_SEARCH" and output as a table VAR_OUT with one field in it 'NAME'. There is no input.

/********* Begin Procedure Script ************/

BEGIN,

VAR_OUT"= SELECT "NAME"

FROM "_SYS_BIC"."My-Schema/MY_ANALYTICAL_VIEW"

WHERE ("NAME" IN ('JOE','JIM')) GROUP BY "NAME";

END;

/********* End Procedure Script ************/

Once I save and activate it, the runtime version of the procedure appeared under _SYS_BIC , under folder "Procedure" as My-Schema/NAME_SEARCH

Next - I opened the SQL editor and entered-

CALL "_SYS_BIC"."My-Schema/NAME_SEARCH";

and received the following error " Wrong number or types paramters in call: My-Schema/NAME_SEARCH : Line 1, column 17; (at pos16).

I tried:

CALL "_SYS_BIC"."My-Schema/NAME_SEARCH" (VAR_OUT)

I receive "Identifier mustbe declared"

I try to declare it as the table type that is generated in _SYS_BIC

CALL "_SYS_BIC"."My-Schema/NAME_SEARCH" (VAR_OUT) OUT "_SYS_BIC"."my-schema/NAME_SEARCH/tabletype/VAR_OUT")

and i received "Syntax error near "OUT" statement"

Any help will be appreciated.

Thanks!