Informix Error -24303: Table (%s) is not the source table.
Cause and resolution
Table (%s) is not the source table.
This error is generated when a user tries to insert into the target table using the column from the target table. For example:
create table bonus (id int, bonus int); create table emp(id int, salary int);
MERGE INTO bonus D USING emp S ON D.id = S.id WHEN MATCHED THEN UPDATE SET bonus = bonus + salary*.01 WHEN NOT MATCHED THEN INSERT (D.id, D.bonus) VALUES (D.id, salary);
This will generate the following error because the salary column in the VALUE clause is not from the source table, emp:
24303: Table (d) is not the source table. Error in line 4 Near character position 61
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-24303 fires when a MERGE INTO statement's VALUES clause qualifies a column with a
table name other than the actual source table — per the official guidance.
- A
VALUESclause column qualified with a table name that isn't theMERGE's source table, per the official guidance — the direct, only cause.
Solutions / Resolution
- Qualify
VALUESclause columns with the source table's own name (or leave them unqualified), per the official guidance.
Examples
A VALUES clause column qualified with the target table's name
CREATE TABLE bonus (id INT, bonus INT);
CREATE TABLE emp (id INT, salary INT);
MERGE INTO bonus D
USING emp S ON D.id = S.id
WHEN MATCHED THEN UPDATE SET bonus = bonus + salary * .01
WHEN NOT MATCHED THEN INSERT (D.id, D.bonus) VALUES (D.id, salary);
-- -24303: D.id qualifies with the target D (bonus), not the source table emp
Corrected
MERGE INTO bonus D
USING emp S ON D.id = S.id
WHEN MATCHED THEN UPDATE SET bonus = bonus + salary * .01
WHEN NOT MATCHED THEN INSERT (D.id, D.bonus) VALUES (S.id, salary);
Diagnostic Checks
- Check every table qualifier used in the
VALUESclause, and confirm each names the actual source table.
Related Errors / Related Topics
- -24300 — "Column (%s) not found in the target table." A related
MERGE-statement restriction, on theINSERTcolumn list. - -24301 — "Table (%s) is not the target table." The mirror-image error, for the
INSERTcolumn list qualifying with the wrong table name. - -24302 — "Column (%s) not found in the source table." A related
MERGE-statement restriction, on a column not belonging to the source table at all, rather than being correctly named but wrongly qualified.
A MERGE's VALUES clause qualified a column with a table name other than the actual
source table — qualify with the source table instead.