Informix Error -843: Cannot write temp file.
Cause and resolution
Cannot write temp file.
Informix SQL is trying to write the current SQL source file into a temporary file for editing but received an unexpected operating-system return code. Look for operating-system error messages that might give more information. On UNIX systems, possibly your account does not have write access to /tmp or the directory that is named in the DBTEMP environment variable, or the disk might be full. With Version 5.01 and later, 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
-843 fires when the interactive tool can't write the current SQL source into a temp file for
editing — per the official guidance, on UNIX systems, likely a permissions problem on /tmp or
the directory named by DBTEMP, or a full disk. DBTEMP itself, per the official guidance, is
specific to IBM Informix SE from Version 5.01 onward — IBM Informix Dynamic Server and OnLine
Dynamic Server don't use it.
- No write access to
/tmp(or theDBTEMPdirectory, on Informix SE), per the official guidance — the direct, likely cause on UNIX systems. - A full disk in the filesystem holding the temp directory, per the official guidance.
DBTEMPset to a directory that doesn't exist or isn't writable, on Informix SE specifically, per the official guidance's version-scoping note (the sameDBTEMPbehind -539's 80-character path-length limit).
Solutions / Resolution
- Look for OS-level error messages that might give more information, per the official guidance.
- Check write access to
/tmp(orDBTEMP's directory, on Informix SE):ls -ld /tmp echo "$DBTEMP" - Check disk space, per the official guidance:
df -h /tmp - Confirm which product is in use, since
DBTEMPonly applies to Informix SE — on Dynamic Server/OnLine Dynamic Server, this error's cause is scoped to/tmpalone.
Examples
Checking /tmp and DBTEMP
$ ls -ld /tmp
$ echo "$DBTEMP"
$ df -h /tmp
Diagnostic Checks
- Check write access and disk space on
/tmp, and on Informix SE,DBTEMP's directory.
Related Errors / Related Topics
- -842 — "Cannot read temp file." The read-side counterpart to this write-side temp-file failure.
- -539 — "DBTEMP too long." A related
DBTEMPrestriction, on Informix SE specifically, for a path exceeding 80 characters rather than a write failure.
Check /tmp write access and disk space (and DBTEMP specifically on Informix SE).