Is cursor open???
Posted in 2000
Topics: General Discussion
How can i check if a cursor has been opened or not?? If i fetch on a cursor that is not open the program chukes. The problem is that a user can attempt to fetch a row before querying up the data so i must deal with un-opened cursors. Thnaks! -- original guitar music at http://www.mindspring.com/~nlymbo
Check for an SQLCODE of -400: fetch attempted on an unopen cursor. "steveFarris" <nlymbo@mindspring.com> wrote in message news:3991A550.9A51FA47@mindspring.com... > How can i check if a cursor has been opened or not?? If i fetch on a > cursor that is not open the program chukes. The problem is that a user > can attempt to fetch a row before querying up the data so i must deal > with un-opened cursors. Thnaks! > > -- > original guitar music at > http://www.mindspring.com/~nlymbo > >
If there is a place you are keeping track of your cursors, add a flag indicating whether the cursor is opened or not. Otherwise trap the sqlcode -400 on the FETCH, open the cursor and re-FETCH. Art S. Kagel steveFarris wrote: > > How can i check if a cursor has been opened or not?? If i fetch on a > cursor that is not open the program chukes. The problem is that a user > can attempt to fetch a row before querying up the data so i must deal > with un-opened cursors. Thnaks! > > -- > original guitar music at > http://www.mindspring.com/~nlymbo