Informix Error -1327: An insert statement could not be prepared for inserting rows into a temporary table used for a report.
Cause and resolution
An insert statement could not be prepared for inserting rows into a temporary table used for a report.
Within the report function, 4GL generated an SQL statement to save rows into a temporary table. The dynamic preparation of the statement (see the reference material on the PREPARE statement) produced an error. Probably the database tables are not defined now, at execution time, as they were when the program was compiled. Either the database has been changed, or the program has selected a different database than the one that was current during compilation. Possibly the database administrator has revoked SELECT privilege from you for one or more of the tables that the report uses. Look for other error messages that might give more details.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1327 fires when 4GL can't dynamically prepare an INSERT statement for a temporary report
table — per the official guidance, common causes include a database schema change since
compilation, connecting to a different database than at compile time, or lost SELECT privilege
on a table the report uses.
- A database schema change since the program was compiled, per the official guidance — the first named cause; tables no longer defined the same way at execution time as they were at compile time.
- The program connected to a different database than the one used during compilation, per the official guidance — the second named cause.
- Lost
SELECTprivilege on a table the report depends on (revoked since compilation), per the official guidance — the third named cause.
Solutions / Resolution
- Check for additional error messages, per the official guidance, for more specific detail.
- Verify database tables remain defined as they were when the program was compiled, per the official guidance.
Examples
Checking privilege and schema drift
SELECT tabname, owner FROM systables WHERE tabname = 'orders';
SELECT grantee, tabauth FROM systabauth WHERE tabid =
(SELECT tabid FROM systables WHERE tabname = 'orders');
Diagnostic Checks
- Confirm the program is connected to the intended database.
- Check for schema changes on the report's underlying tables since compilation.
- Confirm the connecting user still has
SELECTprivilege on those tables.
Related Errors / Related Topics
- -1328 — "A temporary table needed for a report could not be created in the selected database." A related report-generation error, about the temp table's own creation rather than inserting rows into it.
- -1329 — "A database index could not be created for a temporary database table needed for a report." A related report-generation error, about the temp table's index.
Couldn't prepare the report's INSERT statement — check for schema drift, wrong database
connection, or lost SELECT privilege since compile time.