Tom123456
Tom123456

Reputation: 77

Not able to drop a table in db2 luw 9.7

I have created a table with the name "SCHEMA"."CARD_key_1".

CREATE TABLE "SCHEMA"."CARD_key_1"  (

              "CARD_SKEY" BIGINT NOT NULL ,

              "CARD_ENCRYPT" VARCHAR(200) NOT NULL )

             COMPRESS YES

             DISTRIBUTE BY HASH("CARD_ENCRYPT");

               IN "TS_05" INDEX IN "TS_IDX_05" ;

Now when I am trying to drop this table, its not allowing me to drop.

db2 drop table schema.card_key_1

kindly guide!

Upvotes: 0

Views: 485

Answers (2)

Shridhar Kulkarni
Shridhar Kulkarni

Reputation: 21

Try db2 "drop table .". Also, try to see the table by using: db2 describe table .. If table has double quotes then use the same. Please let us know the results. Thank you.

Upvotes: 0

mustaccio
mustaccio

Reputation: 18945

When you created your table you enclosed the table name in double quotes, which effectively made the name case-sensitive. Now you have to quote the table name each time you refer to it. If the table name (or other identifier) is not quoted, it will be converted to the upper case by default. In addition to that you need to ensure that the shell where you run the drop statement does not interpret the quotation marks:

db2 'drop table schema."CARD_key_1"'

Upvotes: 1

Related Questions