Opening a PUT cursor not in a tranasaction
Posted in 1998
Hi Family.
I am practicing the use of dynamic SQL with SQL descriptors and have run
into a strange behavior.
After preparing the INSERT statement and declaring a cursor for it
(DESCRIBE is in there someplace but not relevant to this problem) I
issue the open statement:
exec sql open :sq_cursorid; /* Name of cursor is in char[] */
I got error -255/0 on this open statement.
$ finderr 255-255 Not in transaction.
I don't recall any requirement that an insert cursor can be opened only
in a transaction.
BTW, when I put BEGIN/COMMIT work statements around that section of
code it executed correctly.
exec sql BEGIN WORK;
exec sql open :sq_cursorid;
exec sql put :sqcusorid using sql descriptor :sq_descriptor;
exec sql flush :sq_cursorid
exec sql commit work;
This is with ESQL release 7.11.UC1 on an HP-UX 10.01 system.
The database is "unbuffered" logging.
Can anyone make sense of this situation? While it is certainly a good
idea to do my stuff in a transaction, I should not be forced to do so,
considering that the engine will insert BEGIN and COMMIT around [the log
entry for] each inserted row.
--
-- Jake (Retrospectively realizes there is no future in hindsight)
+------------------------------------------------------------+
| The expedient performance of a task with excessive concern |
| regarding its duration-to-completion engenders a virtual |
| certainty of diminished benefit therefrom. |
| -- Benjamin Franklin (but he said it in 3 words) |
+------------------------------------------------------------+