Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 10116

Re: Issues with cursor

$
0
0

As Bret has alluded to, your UPDATE is most likely affecting the data in such a way that it causes the cursor data set to change.  By default ASE 15.x cursors are defined as semi-sensitive meaning that changes to the underlying data may be visible to the cursor.

 

While it may be possible to modify your code to eliminate the 'missing data' issue, that would require you to provide the *complete* structure of the #temp_table table/index, the *complete* cursor declaration statement, the UPDATE statement(s), and the structure of your looping construct (eg, are you opening/closing the cursor within a looping construct) ... basically ... we'd need to see pretty much all of your code.

 

Alternatively, in ASE 15.x you can declare the cursor as 'insensitive' (ie, changes to underlying data do not show up in the cursor result set).  Ideally the optimizer should force a worktable to be built from which the cursor will perform its fetches.

 

As a first pass at addressing your issue I'd probably just declare the cursor as insensitive to see if this addresses your issue:

 

               declare <cursor_name> insensitive cursor for

               select ...

               for read only

 

If the insensitive cursor does not work then it'll probably be necessary to review/redesign the code (eg, #temp_table structure, cursor structure, processing logic).


Viewing all articles
Browse latest Browse all 10116

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>