cancel
Showing results for 
Search instead for 
Did you mean: 

How to call/test Procedure with parameter table type

Former Member
0 Kudos

Hello Everyone,

I have to check output tables in procedure and also want to test the procedure.

This proc contains all input and output as table types.Not sure how to test it.Can anyone help me to understand with an example.

I found the below syntax:

Syntax:

CALL <proc_name > (<param_list>)

Syntax Elements:

<param_list> ::= <param>[{, <param>}...]

Specifies procedure parameters.

<param>::= <in_table_param> | <in_scalar_param> |<out_scalar_param> |

<out_table_param>

Parmeters can be of table or scalar type.

<in_table_param> ::= <read_variable_identifier>|<sql_identifier>

Thanks,

Kiran

Accepted Solutions (1)

Accepted Solutions (1)

sagarjoshi
Advisor
Advisor
0 Kudos

Hello Kiran,

Please explain from where you want to test. Do you want to test with HANA Studio?

If yes then you need to create a wrapper test procedure to pass the input table type to called procedure. The code would look like below for the test procedure.

After that you can directly use  call test_procedure() from studio.

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

BEGIN

-- Generate multiple rows for input test. Dummy is really a HANA dummy table

-- If you have test data in some other table then you can use that as well

lt_input_tab = select 'f11' as field1, 'f12' as field2 from dummy

                     union

                       select 'f'21' as field1, 'f22' as field2 from dummy;

call <schema>.<procedure> (:lt_input_tab, et_output_tab);

select * from :et_output_tab;

END;

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

Answers (0)