Re: Help! with ESQL cursors
Posted in 1993
In article <1nj5lmINNdto@emory.mathcs.emory.edu> dave.snyder@snide.com (Dave Snyder) writes: >} and hope that the record hasn't been deleted. >} >Why? What I didn't mention, but a good programmer always does, is check >the value of sqlca.sqlcode. If the row is gone for whatever reason, you >print a message to that effect. The only remaining problem then is if a row is deleted and a new one subsequently inserted which uses the same rowid. A slightly better solution, but harder to implement, is to save your primary key value in the dynamic array instead of the rowid. Then at least you guarantee fetching the same rows on each pass. The _other_ remaining problem is if a row is modified between passes such that it no longer satisfies your query conditions; REPEATABLE READ fixes this at a cost of reduced concurrency. [Having said all this, our libraries use the rowid approach. Deleted & reinserted rows have never yet caused a problem in practice. It's just good to know the potential problems.] -- Hugh Grierson Fujitsu/ICL New Zealand - Software Development Centre hugh@nezsdc.icl.co.nz