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 > No table to drop a tbale

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-28-09, 11:29
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
No table to drop a tbale

Someone has create a table that has a double quote in its name i.e.

tabschema.tab"name

I have to drop it, but that double quote is messing everything up. I have done it long time back, but now not able to find a solution.

anyone has a solution?

Thank you
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #2 (permalink)  
Old 08-28-09, 11:59
dbamota dbamota is offline
Registered User
 
Join Date: Sep 2003
Posts: 237
Enclosing in single quote or using 2 double quotes or using reverse slash before " to negate the special meaning come to mind

'tab"nm' "tab""nm" tab\"nm
__________________
mota
Reply With Quote
  #3 (permalink)  
Old 08-28-09, 14:38
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by dbamota
Enclosing in single quote or using 2 double quotes or using reverse slash before " to negate the special meaning come to mind

'tab"nm' "tab""nm" tab\"nm
if it does not work, export table, drop all tables with this schema (admin_drop_schema proc), and import to recreate all other tables. Of course it depends on how many other tables are under this schema.
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #4 (permalink)  
Old 08-28-09, 15:17
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Single quotes are string delimiters. Here we have an identifier and you need to enclose that in double-quotes. So the 2nd option given by dbamota works - the other 2 don't.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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