Informix Error -941: String processing error while evaluating function (function_name).
Cause and resolution
String processing error while evaluating function (function_name).
An error occurred during evaluation of the case conversion function on the input string. This error could be due to an invalid character (single- or multi-byte) in the string. You need to execute the query again after verifying that the characters in the input string are valid.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-941 fires when a case-conversion function (such as UPPER/LOWER) encounters an invalid
character (single- or multi-byte) in its input string — per the official guidance, this is the
specific, named cause.
- An invalid single-byte character in the input string, per the official guidance.
- An invalid or malformed multi-byte character in the input string, per the official guidance — plausible on a multi-byte code set where a byte sequence doesn't form a valid character.
- A code-set/locale mismatch between how the data was actually encoded and how the database session interprets it, producing what looks like an invalid character to the case-conversion function even though the underlying data may be fine in its original encoding.
Solutions / Resolution
- Verify that the characters in the input string are valid, per the official guidance, for the database's configured code set/locale.
- Execute the query again, per the official guidance, once the input data is confirmed (or corrected) to contain only valid characters.
- Check for a code-set/locale mismatch if the data was loaded from a source using a different encoding, since that's a plausible source of apparently-invalid characters.
Examples
Checking a specific row's data for invalid characters
SELECT order_id, LENGTH(status) FROM orders WHERE order_id = 42;
-- inspect the raw data (e.g. via a hex dump at the application level)
-- for byte sequences that don't form valid characters in the database's
-- configured code set
Diagnostic Checks
- Identify the specific row/value causing the failure, and inspect its raw bytes against the database's configured code set for validity.
- Check for a code-set/locale mismatch if the data came from an external source.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -941 in this set yet.
An invalid character (often from a code-set/locale mismatch) in the input to a case-conversion function — inspect the specific row's raw bytes against the database's configured code set.