Informix Error -727: Invalid or NULL tblspace number given to dbinfo(dbspace).
Cause and resolution
Invalid or NULL tblspace number given to dbinfo(dbspace).
You called the dbinfo() function with the 'dbspace' string constant as the first parameter. You must provide either the number of a valid tablespace or an expression that evaluates to such a number as the second parameter. Check that you supplied a number as your second parameter and that it corresponds to the number of a valid tablespace.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-727 fires when DBINFO('dbspace', ...)'s second argument isn't a valid tablespace number — per
the official guidance, this argument must be an actual tablespace number, or an expression that
evaluates to one, not NULL or an arbitrary value.
- The second argument evaluating to NULL, per the official guidance — for example, a variable that was never assigned.
- A number that doesn't correspond to any actual tablespace, per the official guidance — the value is syntactically fine but doesn't identify a real tablespace.
- The wrong kind of identifier passed (a
tabidinstead of a tablespace number, or vice versa), since the two aren't interchangeable.
Solutions / Resolution
- Check that the second argument supplies a number, per the official guidance, and that it corresponds to a valid tablespace.
- Confirm the variable/expression used isn't NULL at the point
DBINFO('dbspace', ...)evaluates it. - Look up the correct tablespace number, if unsure which value identifies the table/index of
interest —
DBINFO('dbspace', ...)specifically requires the value fromsystables.partnum, notsystables.tabid; the two are related but distinct concepts on Informix.
Examples
A NULL second argument
DEFINE v_partnum INT;
-- v_partnum was never assigned
SELECT DBINFO('dbspace', v_partnum) FROM systables WHERE tabid = 1;
-- -727: v_partnum is NULL
Corrected — a real value
DEFINE v_partnum INT;
LET v_partnum = (SELECT partnum FROM systables WHERE tabname = 'orders');
SELECT DBINFO('dbspace', v_partnum) FROM systables WHERE tabid = 1;
Diagnostic Checks
- Confirm the second argument to
DBINFO('dbspace', ...)is non-NULL and corresponds to a real tablespace (i.e. it's asystables.partnumvalue, not atabid) before running the statement.
Related Errors / Related Topics
- -726 — "First argument to dbinfo() must be a quoted string constant." A related
DBINFO()error, about the first argument's own type/quoting rather than the second argument's value. - -728 — "Unknown first argument of dbinfo(argument)." A related
DBINFO()error, about the first argument not matching any recognized value at all.
Confirm the second argument to DBINFO('dbspace', ...) is a real, non-NULL tablespace number
before running the statement.