Informix Error -222
-222 Cannot write to temporary file for new table table-name.
The database server created a temporary disk file but received an error while it attempted to write into the file. Check the accompanying ISAM error code, and look for operating-system messages that might give more information. On UNIX systems, the file should have been created in the directory specified by the DBTEMP environment variable (/tmp by default); on DOS systems, the file should be in the current directory. Possibly that disk is full, or a hardware error occurred. Since Version 5.01, the IBM Informix SE database server uses the DBTEMP environment variable, but IBM Informix Dynamic Server and IBM Informix OnLine Dynamic Server do not.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-222 is the direct sibling of -221: the temporary disk file was created successfully, but
writing to it failed. Same product-specific configuration split applies — DBTEMP for IBM
Informix SE, DBSPACETEMP for Dynamic Server/OnLine Dynamic Server (see -221 and
-179/-199).
- A full disk in the temp directory — space was available at creation time but ran out during the write.
- Hardware failure affecting the underlying storage.
- Permission or filesystem issues arising mid-operation, even if the initial file creation succeeded.
- The same product-specific configuration confusion as -221 — checking
DBTEMPon Dynamic Server, which doesn't use it, or vice versa.
Solutions / Resolution
- Check the accompanying ISAM error code and OS-level messages, per the official guidance — the specific cause is there, not in this generic wrapper.
- Check disk space in the temp directory — since the file was created but writing failed, space exhaustion mid-operation is a strong candidate.
- Check hardware/filesystem health if space isn't the issue.
- Confirm which product is in use before checking
DBTEMP(SE) versusDBSPACETEMP(Dynamic Server/OnLine Dynamic Server) — the same distinction as -221.
Examples
Space exhausted mid-write
df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 10G 10G 0 100% /tmp
-- the temp file was created when a little space remained,
-- but a large intermediate result exhausted it during the write
Freeing space, or pointing DBTEMP/DBSPACETEMP at a larger volume, resolves this.
Diagnostic Checks
- Check the accompanying ISAM error code.
- Check disk space in the relevant temp directory.
- Check hardware/filesystem health.
- Confirm which product is in use to know which configuration variable actually applies.
Related Errors / Related Topics
- -221 — "Cannot build temporary file for new table table-name." The direct sibling — same configuration mechanics, at file-creation time instead of write time.
- -179 — "ISAM error: No free disk space for sort." Related
DBSPACETEMPconfiguration topic for Dynamic Server products.
Check disk space first — since the file was created but the write itself failed, space exhaustion occurring mid-operation is the most likely explanation.