View previous topic :: View next topic
|
Author |
Message |
venkata_naresh
New User
Joined: 16 Feb 2007 Posts: 2 Location: Markapur
|
|
|
|
Hi, I have declare a DEPOSIT-CURSOR in my program where i will read account number from file and get the sum of deposit balance by fetching and summing up deposit balance from cursor. The problem i am facing is the cursor is retrieving data correctly for the first account from the file. starting from second account number it is returning same rows as of the first account. appreciate help and ideas. |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
My guess is May be you are not reading the file inside fetch cursor loop..
Helpful if you post the portion of your code |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Is the cursor defined for one account number?
Did you close and open the cursor when account number changes? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
If there is a host variable in your where clause and it changes then you must close and open the cursor again |
|
Back to top |
|
|
rajeshps19
New User
Joined: 14 Feb 2007 Posts: 4 Location: Noida
|
|
|
|
Hi Naresh,
As per my understanding you are reading account-no from file and then getting the related data thru cursor. Since u are using cursor, the account-no host variable should be populated with new values from file before opening the cursor again. You should also close the cursor once u retrieve data for one acct-no. Then again open the cursor for next acct-no. If u don't close the cursor then it will retrieve the same data as previous due to the cursor pointing to the previous record.
Thanks,
Rajesh. |
|
Back to top |
|
|
|