Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2002
    Posts
    165

    Unanswered: 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

  2. #2
    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

  3. #3
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    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/2012
    Wim

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •