Oninit Logo
The Down System Specialists
+1-913-674-0360
+44-2081-337529
Partnerships Contact
Finderr

-265 Load or insert cursors must be run within a transaction.

You attempted to open an insert cursor. This database has a transaction log. In such a database, you must execute a BEGIN WORK statement before you open a cursor that is declared with an INSERT statement or with the FOR UPDATE clause. Revise the logic of your program so that it starts a transaction before it opens the cursor.

You can ensure that the program also works in databases that do not have a transaction log. Change the program so that immediately after it executes the DATABASE statement, it saves the contents of the second element of the SQLAWARN array of warning flags in the SQL communications area. This element will contain a space if the database does not use transactions, and the letter W if it uses them. At each point where a transaction logically begins or ends, test the saved value. If it contains W, execute the transaction statement to begin or end a transaction.