# Db2 SQL0204N: "SCHEMA.TABLE" is an undefined name (SQLSTATE 42704)

**Code:** `SQL0204N` · **Category:** SQL · **Seen on:** Db2, SQL

Db2 can't find the table, view or other object, or the schema qualifier is wrong.

## Meaning

Qualify with the schema (`MYSCHEMA.ORDERS`) or set `SET SCHEMA`/`CURRENT SCHEMA`, check case (unquoted names are uppercase), connect to the right database, and confirm the object exists (`SELECT * FROM syscat.tables`).

## Common causes

- Missing or wrong schema qualifier
- Connected to the wrong database
- Case-sensitive quoted name
- Object not created or dropped
- Alias/nickname missing

## Quick fix

1. `SET SCHEMA myschema;` or qualify names
2. Check `syscat.tables`
3. Verify the connected database

## Detailed fix by platform

### SQL

1. 

```sql
SELECT tabschema, tabname FROM syscat.tables WHERE tabname = 'ORDERS';
SET SCHEMA myschema;
```


## How to diagnose

1. **Schema** — Qualified?
2. **Database** — Right one?
3. **Case** — Matches?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/sql/db2-sql0204n-undefined-name)
