Informix Error -1328: A temporary table needed for a report could not be created in the selected database. The user must have permission to create tables in the selected database.
Cause and resolution
A temporary table needed for a report could not be created in the selected database. The user must have permission to create tables in the selected database.
Within the report definition, 4GL generated an SQL statement to save rows into a temporary table, but the temporary table could not be created. Probably no disk space is left in the database, or you already have a table in your current database with the same name as the temporary table that the report definition is attempting to create as a sorting table.
Another possible cause is that the report name is too long. It should be 16 characters or fewer if your database server allows only table names up to 18 characters long, to leave room for the "t_" prefix.
The sorting table is named "t_reportname". For example, a report named "order_rpt" would name its sorting table "t_order_rpt". Users should avoid beginning table names with "t_".
Another possible cause of this error with some database servers is that you have exceeded an operating-system limit on open files.
Look for other error messages that might give more details.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1328 fires when 4GL can't create the temporary sorting table a report needs — per the official
guidance, the temp table is automatically named t_reportname (e.g. t_order_rpt for a report
named order_rpt); common causes include insufficient disk space, a name conflict with an
existing table, a report name that's too long, or an OS open-file limit.
- Insufficient disk space in the database, per the official guidance — the first named cause.
- A table with the same name (
t_reportname) already existing, per the official guidance — the second named cause. - The report name too long, per the official guidance — should be 16 characters or fewer if
the database limits table names to 18 characters, accounting for the
t_prefix. - An operating-system limit on open files exceeded, per the official guidance — the fourth named cause.
Solutions / Resolution
- Check available disk space in the database.
- Check for an existing
t_reportnametable conflicting with the automatic name. - Shorten the report name to 16 characters or fewer, per the official guidance, if that's the cause.
- Check the OS open-file limit, per the official guidance.
- Confirm the user has permission to create tables in the selected database, per the official guidance's own title text.
Examples
Checking for a naming conflict
SELECT tabname FROM systables WHERE tabname = 't_order_rpt';
Diagnostic Checks
- Check disk space, an existing
t_reportnameconflict, report-name length, the OS open-file limit, and create-table permission, in that rough order of likelihood.
Related Errors / Related Topics
- -1327 — "An insert statement could not be prepared for inserting rows into a temporary table used for a report." A related report-generation error, about inserting into the temp table once created, rather than the creation itself.
- -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 rather than the table itself.
The report's automatically-named temp table (t_reportname) couldn't be created — check disk
space, naming conflicts, report-name length, and permissions.