Informix Error -4018
-4018 The columns specified in the THRU option do not belong to the same
table.This statement refers to some table first THRU (or THROUGH) last; however first and last are not both columns in that table. Check the spelling of these column names. Make sure that the correct database is current at this point in the compilation (the most recent preceding DATABASE statement).
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4018 fires when a first THRU last (or THROUGH) qualification names two columns that
aren't both columns of the same table — per the official guidance, this also depends on which
database was current at that point in the compilation (the most recent preceding DATABASE
statement).
firstand/orlastaren't both columns of the referenced table, per the official guidance — the direct, only cause.- The wrong database was current at that point in compilation, per the official guidance — a related cause worth checking.
Solutions / Resolution
- Check the spelling of both column names, per the official guidance.
- Make sure the correct database is current at this point (check the most recent
preceding
DATABASEstatement), per the official guidance.
Examples
A THRU range naming columns from different tables
DISPLAY orders.order_id THRU customer.cust_id
-- -4018: order_id and cust_id aren't both columns of the same table
Corrected
DISPLAY orders.order_id THRU orders.order_date
Diagnostic Checks
- Check whether both
THRU-range columns belong to the same table, and confirm the correct database was current at that point in the source.
Related Errors / Related Topics
- -4019 — "The columns specified in the THRU option appear in the reverse order." A
related
THRU-option error, about column ordering rather than table membership.
The two columns in a THRU/THROUGH range don't belong to the same table — check their
spelling and the current database context.