# SQLCODE -205: Column not in the named table

Source: https://wndsoftware.com/mainframe-errors/sqlcode-205

### SQLCODE -205: Column not in the named table

SQLCODE -205 (SQLSTATE 42703) means the statement names a column that doesn't exist in the table or view the message names. Db2 found the table but not the column.


#### Other names for this code

Also written as `SQL -205`, `SQLCODE=-205`, `SQLCODE = -205`, `db2 -205`, `sqlstate 42703`, `SQL0205N`, `is not a column of table`.


### What it means

The message gives both names, the column and the table, so you know exactly where Db2 looked. The table exists. It just has no column by that name.

-205 and -206 share SQLSTATE 42703 and are easy to mix up. In Db2 for z/OS, -206 is the usual code for an unknown column in a query, where Db2 searched every table in the FROM clause and found no match. In practice -205 shows up most often in statements that name a table and its columns directly, such as CREATE INDEX, ALTER TABLE, COMMENT ON and LABEL ON. Either way the fix is the same kind of check.

Because the table is named in the message, -205 is also a good clue when a qualifier is wrong. If the same table name exists in test and production with different columns, the schema in the message tells you which copy Db2 used.


### Common causes

- The column name is misspelled, or uses the COBOL field name with hyphens instead of the Db2 column name with underscores.
- The column was added to one copy of the table, such as test, but not yet to the copy this statement uses.
- The column was renamed or dropped, and a DDL script or program still uses the old name.
- The statement is qualified with the wrong schema, so it reaches a different copy of the table.


### How to find the problem

- Read the column and table names in the `DSNT408I` message or SQLERRMC, including the schema.
- List the table's real columns with `SELECT NAME, COLNO FROM SYSIBM.SYSCOLUMNS WHERE TBCREATOR = 'PAYPROD' AND TBNAME = 'EMP_HIST' ORDER BY COLNO`.
- Compare with the same table in other environments if the statement works there.
- For a DDL script, check whether an earlier step that should have added or renamed the column ran successfully.


### How to fix it

- Correct the column name in the statement.
- Apply the missing ALTER TABLE to this copy of the table, or run the scripts in the right order.
- Fix the schema qualifier, or the QUALIFIER bind option for a package, so the statement reaches the right table.
- Regenerate DCLGEN after a table change so programs use current column names.


### What it looks like


```text
DSNT408I SQLCODE = -205, ERROR:  HIRE_DT IS NOT A COLUMN OF TABLE PAYPROD.EMP_HIST
DSNT418I SQLSTATE   = 42703 SQLSTATE RETURN CODE
```


### IBM documentation

[IBM documentation: -205](https://www.ibm.com/docs/en/db2-for-zos/13.0.0?topic=codes-205). Use the documentation for your installed release.

[Report a correction to WND Software](https://wndsoftware.com/contact#message).

Technical reviewer: [Albert Joseph](https://wndsoftware.com/authors/albert-joseph), WND Software.

Last reviewed 2026-10-18 by the WND Software team. Written in our own words. For the full reference, check IBM’s Db2 for z/OS documentation for your release.


### Related codes

[SQLCODE -206 Column name not valid Read →](https://wndsoftware.com/mainframe-errors/sqlcode-206)
[SQLCODE -204 Undefined object name Read →](https://wndsoftware.com/mainframe-errors/sqlcode-204)
[SQLCODE -203 Ambiguous column reference Read →](https://wndsoftware.com/mainframe-errors/sqlcode-203)
[SQLCODE -117 Number of values doesn't match columns Read →](https://wndsoftware.com/mainframe-errors/sqlcode-117)

### Questions


#### What's the difference between -205 and -206?

Both mean a column wasn't found and both use SQLSTATE 42703. -205 names the table Db2 looked in. -206 is the usual code when a column in a query matches no table in the FROM clause.


#### Why does the statement work in test but not production?

The column probably exists only in the test copy of the table. Compare SYSIBM.SYSCOLUMNS on both systems.


#### Is it the same on Db2 for LUW?

SQL0205N has SQLSTATE 42703 and means the column, or attribute of a structured type, isn't defined in the named object.

[Db2 SQLCODEs](https://wndsoftware.com/mainframe-errors/db2-sqlcodes) · [SQLCODE -204](https://wndsoftware.com/mainframe-errors/sqlcode-204) · [SQLCODE -206](https://wndsoftware.com/mainframe-errors/sqlcode-206)

[← All error codes](https://wndsoftware.com/mainframe-errors/)
