cancel
Showing results for 
Search instead for 
Did you mean: 

Are input parameters immutable in Stored Procedures in SAP HANA

Former Member
0 Kudos

Hi All,

I am quite new to SAP HANA and actively engaged in modifying MS SQL sever stored procedures in HANA. I am using SQLScript to write the procedures. While trying to modify the input variables in stored procedures I get error. For example, If an input variable (type integer) is 0 then i want to set it to null. Currently i am storing the input variable in another temporary variable and then modifying it. Are the input variables immutable ? OR am i missing something?

Also, while trying to fill the output variable (which is table type) if I use the function IFNULL it throws error on certain input values. I am having to use another explicit select query to put the result (which i want to achieve using IFNULL) in temporary variable and then use this variable while filling the output variable. Is there another good way of doing it?

Is there any good tutorial for SAP HANA specifically for stored procedures. I could google a few but none of them seem to explain extensively

Thanks,

Nikhil

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185132
Active Contributor
0 Kudos

Hi,

I tried this just now. You cannot overwrite an input parameter like this: inp_param = <<some_value>>;

However, the below syntax does work.


create procedure testMutable(in someInt integer, out anotherInt integer)

reads sql data

as begin

  if someInt > 15 then

  select 15 into someInt from dummy;

  end if;

  anotherInt := someInt;

end;

call testMutable(10,?);

call testMutable(16,?);

This will show 10 as the result for the first call, and 15 as the result of the second call.

Regarding IFNULL, please give examples where you are getting errors.

Regards,

Suhas