Cursor question: WITH HOLD + FOR UPDATE 
Author Message
 Cursor question: WITH HOLD + FOR UPDATE

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.



Teradyne Telecommunications                      (708) 940-9000 ext. 2747
Deerfield, Illinois  USA

Sun, 16 Oct 1994 22:54:12 GMT
 [ 1 post ] 

 Relevant Pages 

1. How to hold an update cursor with ESQL/C

2. with hold cursors or workarounds

3. Using Hold Cursors with JDK 1.1

4. Is there a CURSOR WITH HOLD in Sybase?

5. JDBC and holding cursors

6. CURSOR WITH HOLD and enterprise replication

7. Creating a hold cursor

8. Hold Cursor in JDBC?

9. NewEra: simulate CURSOR WITH HOLD

10. Help: Stored Procedures Implicit cursors with hold closed

11. Hold cursors closed after rollback

Powered by phpBB® Forum Software