on 05-06-2015 7:26 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.