Page 1 of 1

Group Functions in CURSOR

PostPosted: Fri Aug 14, 2009 10:39 pm
by prasadnaidu
Sir, may i use Group functions in a Cursor.

Declare cursor1 cursor for
select pol-type, sum(pol-amt) from policy
group by pol-type
......
.......
.......
fetch cursor1 into :hv-pol-type, :totamt
......

in above code i get an error is Unusable or Undefined Host Variable "totamt"
here "TOTAMT" is a working-storage variable

what is the reason

Re: Group Functions in CURSOR

PostPosted: Mon Sep 21, 2009 11:19 am
by momi sabag
Hi

there is no problem with group functions in a cursor,
recheck that your host variable was defined properly

Momi