Cursor question: WITH HOLD + FOR UPDATE
Posted in 1992
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hello, Fellow Informix users! I just re-read the manual page for 'declare cursor' again, and I'm a bit confused. Perhaps someone can help! 'Declare cursor' has two optional clauses that I'd like to use together - WITH HOLD and FOR UPDATE. There is a reference to using this combination, but it has to do with the opening and closing of the cursor. What I want to happen is to be able to lock a record (row) using the FOR UPDATE clause, but preserve the lock if I perform a ROLLBACK. I was hoping that the lock would be preserved because I had used the WITH HOLD clause, but experience seems to indicate otherwise. I guess my first question is - am I attempting a 'legal' operation? Or is my interpretation of the combination incorrect? If the WITH HOLD - FOR UPDATE combination won't behave as desired, is there any mechanism that can? I'd rather not have to re-open the cursor and re-fetch the record; it kind of defeats the purpose of the 'lock'... For the record, I'm running Informix-SE 4.00.UH1 on a Sun Sparcstation 1; the above was coded in ESQL/C. I appreciate all help! Thanks in advance. Joe -- Joseph P. Tokarski tokarski@ttd.teradyne.com Teradyne Telecommunications (708) 940-9000 ext. 2747 Deerfield, Illinois USA