on 07-02-2013 9:46 AM
Hi All,
We have a cursor declared in a stored procedure.
While debugging this stored procedure, I noticed that if there are 10 rows (for example) satisfying the cursor criterion, when we loop through the cursor
data using "while @@sqlstatus =0", the cursor is looping for only 4 rows (for example).
So the cursor is not fetching all the rows satisfying the cursor criterion. Can any one explain this.
I hope I explained my issue clearly.
Regards,
Kiran
Clear so far, but some more details would be helpful.
What is your ASE version (select @@version)?
What is the cursor definition?
Does the loop do anything that would modify the data between fetches?
-bret
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bret,
The ASE version is 15.7.
The cursor definition is like :
select distict <columns> from #temp_table (index test_index)
where column1=@li_column and .......
for read only
And the loop does update the data for each fetch.
I also noticed that, if i remove the index from the cursor definition, the loop is processing all the
data satisfying the cursor definition.
- Kiran
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.