Hi John,
Method 2 would give an error for sure as loop's WHILE condition would check whether VAR_2 > 0 and whereas the VAR_2 variable does not hold any value.
However, you should get a similar result(as given below) when trying to execute via the method 1
I tried to build a similar procedure(just the loop part of it)
Output:
If the code goes through loop one should get similar kind of display. If you're getting these kind of screens in method 1 then the select statement could be faulty otherwise if you are not getting these screens then the loop itself has an issue.
I am not able to see why it is not working. The code seems to be correct.
Can you try the same code I have written in your system. Let's see if this piece of code works.
Which version of HANA DB are you using? There might be a slight possibility of bugs with the version you're using. I am on HANA Rev 70.
--
Shreepad