Informix Error -19819: An ON-clause has an invalid table reference.
Cause and resolution
An ON-clause has an invalid table reference.
One of the ON clauses that you specified refers to a table that is not within the scope of the join to which the ON clause belongs.
Check that the tables that you specify in the join criteria and join filters of each ON clause are applicable to the join of which they are a part.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-19819 fires when an ON clause references a table outside the scope of the join it
belongs to — per the official guidance.
- A table referenced in an
ONclause that isn't part of that join, per the official guidance — the direct, only cause.
Solutions / Resolution
- Check that every table in each
ONclause's join criteria/filters is applicable to the join it belongs to, per the official guidance.
Examples
An ON clause referencing an out-of-scope table
SELECT * FROM t1
JOIN t2 ON t1.id = t2.id
JOIN t3 ON t1.id = t4.id;
-- -19819: t4 isn't part of the t1/t3 join
Corrected
SELECT * FROM t1
JOIN t2 ON t1.id = t2.id
JOIN t3 ON t1.id = t3.id;
Diagnostic Checks
- Check each
ONclause's tables against the tables actually in scope for that join.
Related Errors / Related Topics
- -19820 — "Informix OUTER JOIN and ANSI JOIN in the same query block." A related JOIN-syntax error, about mixing join mechanisms rather than an out-of-scope table reference.
An ON clause references a table outside its join's scope — check the tables against the
actual join scope.