Informix Error -1805: Invalid connection name.
Cause and resolution
Invalid connection name.
The connection name is invalid. It must conform to the same rules as any other identifier; that is, it cannot exceed the maximum length, cannot be an ANSI reserved word, must begin with a letter or underscore, and can contain only letters, digits, underscores, and, in IBM Informix Dynamic Server 9.2 or later, dollar-sign characters.
The maximum length for identifiers depends on the database server. In IBM Informix Dynamic Server 9.2 or later, the maximum length is 128 characters. In other Informix database servers, the maximum length is 18 characters.
Check that the connection name is a valid identifier and that you are using the connection name and not some other value. If a connection name was used with the original CONNECT TO statement, you must use the connection name in subsequent connection statements.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1805 fires when a connection name doesn't follow standard identifier rules — per the official guidance, it must not exceed the maximum length, can't be an ANSI reserved word, must begin with a letter or underscore, and may only contain letters, digits, underscores, and (on IDS 9.2+) dollar signs.
- A connection name exceeding the maximum identifier length (128 characters on IDS 9.2+, 18 on earlier servers), per the official guidance.
- A connection name that's an ANSI reserved word, per the official guidance.
- A connection name not starting with a letter or underscore, per the official guidance.
- A connection name containing a character outside letters/digits/underscore (and, on
9.2+,
$), per the official guidance.
Solutions / Resolution
- Verify the connection name is valid, per the official guidance, against the standard identifier rules.
- Ensure the correct connection name is used in subsequent statements, per the official
guidance, matching whatever was specified in the original
CONNECT TO ... ASstatement.
Examples
An invalid connection name
CONNECT TO 'stores7@server_a' AS 1st_connection;
-- -1805: identifiers can't start with a digit
Corrected
CONNECT TO 'stores7@server_a' AS conn_1;
Diagnostic Checks
- Check the connection name against standard identifier rules (length, reserved words, starting character, allowed characters).
Related Errors / Related Topics
- -1802 — "Connection name in use." A related connection-naming error, about a syntactically valid name that's already taken rather than an invalid name.
- -1803 — "Connection does not exist." A related connection error, about referencing a name that isn't established.
The connection name doesn't follow standard identifier rules — check length, reserved words, starting character, and allowed characters.