Informix Error -726: First argument to dbinfo() must be a quoted string constant.
Cause and resolution
First argument to dbinfo() must be a quoted string constant.
The first argument to dbinfo() should be a quoted string constant. If the first argument to dbinfo() is the string 'version', then the second argument should also be a quoted string constant.
-726 First argument to dbinfo() must be a quoted string constant.
Check that the first argument to dbinfo() is a quoted string that corresponds to one of the following values: 'dbspace', 'sqlca.sqlerrd1', or 'sqlca.sqlerrd2'.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-726 fires when DBINFO()'s first argument isn't a quoted string literal — per the official
guidance, it must be exactly that, and specifically one of 'dbspace', 'sqlca.sqlerrd1', or
'sqlca.sqlerrd2' (this error's own text lists these three; other valid DBINFO() arguments
exist on current server versions, such as 'version', 'sessionid', and others, but this
error's own listed values reflect what the specific server version producing it supports).
- An unquoted identifier or a variable passed as
DBINFO()'s first argument, per the official guidance — it must be a literal quoted string, not an expression or variable. - A typo in the quoted string itself, not matching one of the argument names this server version recognizes.
- For
DBINFO('version', ...)specifically, per the official guidance, the second argument must also be a quoted string constant — a variable there triggers the same restriction.
Solutions / Resolution
- Use a literal quoted string for
DBINFO()'s first argument, per the official guidance, matching one of the values this server version supports. - For
'version', also quote the second argument as a literal string, per the official guidance. - Check the exact spelling of the quoted string against the documented set of valid
DBINFO()arguments for the server version in use.
Examples
The disallowed attempt
DEFINE v_arg VARCHAR(20);
LET v_arg = 'sqlca.sqlerrd2';
SELECT DBINFO(v_arg) FROM systables WHERE tabid = 1;
-- -726: DBINFO()'s first argument must be a literal, not a variable
Corrected
SELECT DBINFO('sqlca.sqlerrd2') FROM systables WHERE tabid = 1;
Diagnostic Checks
- Confirm
DBINFO()'s first argument (and, for'version', the second) is a literal quoted string, not a variable or expression.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -726 in this set yet.
DBINFO()'s arguments must be literal quoted strings, never variables — check both the
quoting and the exact spelling against this server version's supported argument list.