Group Functions in CURSOR



IBM's flagship relational database management system

Group Functions in CURSOR

Postby prasadnaidu » Fri Aug 14, 2009 10:39 pm

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
prasadnaidu
 
Posts: 14
Joined: Fri Aug 14, 2009 10:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Group Functions in CURSOR

 

Re: Group Functions in CURSOR

Postby momi sabag » Mon Sep 21, 2009 11:19 am

Hi

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

Momi
momi sabag
 
Posts: 4
Joined: Mon Sep 21, 2009 11:11 am
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post