If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Problem with table name

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-07-06, 03:25
zkajfez zkajfez is offline
Registered User
 
Join Date: Jan 2002
Posts: 161
Problem with table name

So,we use some Tivoli products (Tivoli Warehouse) which use DB2 db for reporting about memory,processors,alerts etc,etc
Table name are
"NT_MEMORY" (slashes are part of name) for example

In DB2CMD when you enter command

DB2 REORG TABLE ITMUSER."NT_Memory" USE TEMPSPACE1

you get the error:

SQL2211N The specified table does not exist.

You can do reorg from Control Center-same syntax obviously works fine

What to do?
Tia,Zvonimir
Reply With Quote
  #2 (permalink)  
Old 09-07-06, 06:26
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
table name

I don't see any slashes in the name
do you mean the double quotes ?
check the real name of the table in sysibm.systables
if mixed case - use " to protect the name
if special characters used in name as " or any other, protect the name
with escape character "\"name .....
or put the instruction in a file (no command interpreter involved)
execute with db2 -tvf filename..
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #3 (permalink)  
Old 09-07-06, 08:14
Wim Wim is offline
Registered User
 
Join Date: Nov 2004
Posts: 1,279
Quote:
Originally Posted by zkajfez
...
Table name are "NT_MEMORY"
...
DB2 REORG TABLE ITMUSER."NT_Memory" USE TEMPSPACE1
...
SQL2211N The specified table does not exist.
Table names are case sensitive in DB2, but DB2 will always perform an implicit upper case conversion when you don't place quotes (") around the name.
So if your table name is NT_MEMORY, you can access this table by:
select * from NT_MEMORY
and
select * from nt_memory
and
select * from "NT_MEMORY"
and
select * from Nt_MeMoRy

But not
select * from "Nt_MeMoRy"

If your table name is NT_Memory, you can access this table only by protecting the given table name from being converted to upper case by putting quotes (") around the name, only in this case, DB2 will take the string literally:
select * from "NT_Memory"

If you would try to use
select * from NT_Memory
DB2 will do an implicit UCASE of your tablename thus giving NT_MEMORY and that's a table it can not find.


So the solution to your problem is: get rid of the quotes around the table name
Code:
DB2 REORG TABLE ITMUSER.NT_Memory USE TEMPSPACE1
or even better use the correct (table) names.
Code:
DB2 REORG TABLE "ITMUSER"."NT_MEMORY" USE "TEMPSPACE1"
__________________
With kind regards . . . . . SQL Server 2000/2005/2008/2008 R2 Earned beers: 16
Wim
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On