View previous topic :: View next topic
|
Author |
Message |
babu_hi
New User
Joined: 11 Apr 2006 Posts: 93
|
|
|
|
can we use GROUP BY clause in declare cursor? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
if it is a fetch only cursor |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
From DB2 Manual I found below:-
A cursor will be automatically classified as
read-only if its SELECT statement is a join of multiple tables or includes such clauses as ORDER BY or GROUP BY.
The above statement says that we can use GROUP BY Clause. But remeber it will be read-only. You cannot do update. |
|
Back to top |
|
|
l.nethaji
New User
Joined: 16 Mar 2008 Posts: 90 Location: tamil nadu
|
|
|
|
its right to delcare cursor using group by clause
declare cursor cur1
select c1,c2 from t1 group by c1,c2
then in the fetch u must give
fetch cur1
into :wc1
into:wc2
wc1 ,wc2 are working storage variables |
|
Back to top |
|
|
|