Informix Error -33030: Cannot have a insert statement on a SCROLL cursor.
Cause and resolution
Cannot have a insert statement on a SCROLL cursor.
This DECLARE statement specifies the SCROLL keyword, but it goes on to specify an INSERT statement. Insert cursors cannot use the SCROLL keyword.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-33030 fires when a DECLARE statement specifies both SCROLL and an INSERT
statement — per the official guidance, insert cursors can't use the SCROLL keyword.
- A
DECLARE ... SCROLL CURSORdeclared for anINSERTstatement, per the official guidance — the direct, only cause.
Solutions / Resolution
- Remove
SCROLLfrom the cursor'sDECLAREstatement, per the official guidance, when the cursor is used forINSERT.
Examples
An INSERT cursor incorrectly declared SCROLL
DECLARE ins_cur SCROLL CURSOR FOR INSERT INTO orders VALUES (?, ?);
-- -33030: insert cursors cannot use SCROLL
Corrected
DECLARE ins_cur CURSOR FOR INSERT INTO orders VALUES (?, ?);
Diagnostic Checks
- Check every
DECLARE ... SCROLL CURSORfor anINSERTstatement, and removeSCROLLif so.
Related Errors / Related Topics
- -33054 — "Updates are not allowed on a scroll cursor." A related
SCROLL-cursor restriction, onUPDATErather thanINSERT.
A SCROLL cursor was declared for an INSERT statement, which isn't allowed — remove
SCROLL from the declaration.