Informix Error -454
-454 'loc_read()' failed.
The loc_read() function provided in the locator structure for a BYTE or TEXT value in this statement was called and returned a negative return code. When the value is located using user-supplied functions (loc_loctype contains LOCUSER), this function is part of the program and you have to diagnose its problems yourself. When the value is located in a file (loc_loctype contains LOCFILE or, in a 4GL program, the variable has been located in a file), this error indicates that the system-supplied loc_read() function was not able to read from the file.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-454 is the read-side counterpart of -452/-453 in the same loc_*()-function family:
loc_read(), invoked as part of a BYTE/TEXT locator operation, returned a negative code.
- When using a user-supplied locator function, the failure is entirely application-defined — diagnosing it is the application developer's own responsibility.
- When using the system-supplied function accessing a file, the read from that file failed — potentially from a disk-level I/O error, the file being truncated/modified externally mid- operation, or similar OS-level conditions.
Solutions / Resolution
- For a user-supplied locator function, add diagnostic logging inside it to determine why
loc_read()is returning a negative code. - For a file-based locator, check for disk-level I/O errors around the time of the failure.
- Check whether the file was modified or truncated externally while the read operation was in progress.
Examples
Checking for external file modification during a read
-- Confirm the file backing a file-based locator wasn't being
-- written to, truncated, or removed by another process while
-- this read operation was in progress.
Diagnostic Checks
- Determine whether a user-supplied or system-supplied (file-based)
loc_read()is in use. - For a user-supplied function, add logging inside it to find the actual failure reason.
- For a file-based locator, check for disk I/O errors or external file modification.
Related Errors / Related Topics
- -452 — "'loc_open()' failed." The open-side counterpart in the same locator-function- failure family.
- -453 — "'loc_close()' failed." The close-side counterpart in the same family.
Same diagnostic split as -452/-453 — determine whether a user-supplied or system-supplied
loc_read() is involved before troubleshooting further.