IBM Support

SQL0204N undefined name error during the Drop Tablespace command.

Troubleshooting


Problem

SQL0204N "tablespace_name" is an undefined name error during the Drop Tablespace command is executed.

Symptom

SQL0204N error will be received during the drop tablespace command if the case sensitivity of the object name is preserved. Here is the test case:

1) Create the tablespace where the case sensitivity of the tablespace is preserved with quotes in the create tablespace command.

db2 "create tablespace \"TEST_TEMP_16K_junk\" managed by database using (file '/home/db2v91/tbsp' 2000)"
DB20000I The SQL command completed successfully.

2) Snippet of the List tablespaces output:

Tablespace ID = 3
Name = TEST_TEMP_16K_junk
Type = Database managed space
Contents = All permanent data. Large table space.
State = 0x0000
Detailed explanation:
Normal

3) Dropping the tablespace with out quotes will return the SQL0204N error because DB2 is looking for TEST_TEMP_16K_JUNK and not for the TEST_TEMP_16K_junk tablespace.

db2 drop tablespace TEST_TEMP_16K_junk
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0204N "TEST_TEMP_16K_JUNK" is an undefined name. SQLSTATE=42704

Note: The case sensitivity of the tablespace name is preserved when the following format is used \"tablespace_name\".

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Database Objects\/Config - Tablespaces","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;9.1","Edition":"Advanced Enterprise Server;Enterprise Server;Express;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

To view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use the link to actual document below to access the full document. You will be asked to log on if you are not already logged in. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

More support for:
Db2 for Linux, UNIX and Windows

Software version:
9.7, 9.5, 9.1

Operating system(s):
AIX, HP-UX, Linux, Solaris, Windows

Document number:
163715

Modified date:
30 April 2025

UID

swg21504917

Manage My Notification Subscriptions