Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: For loop using decimals in SAP HANA

$
0
0

Hi Ramana,

 

If you check the syntax for the "FOR LOOP", it clearly mentions that the

 

<start_value> ::= <signed_integer>

<end_value> ::= <signed_integer>

 

So I don't think you will be able to use decimal. But if you need decimal value to be used in the loop, may be you can use another variable which is a decimal and increment / reduce it by some value by multiplying / dividing by another integer / decimal and use in the loop.

 

For ex:

 

if you want the loop from -4 .. 4, but want to increment by 2, then have the loop for v_index1 from -2 .. 2 and define another variable

v_var1 := :v_index1 * 2

 

This way you can achieve the increment. Similar way you can derive the decimal value and can use in the procedure.

 

Regards,

Ravi


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>