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 > Can't view/drop table with 'Temp' Prefix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-22-08, 18:35
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
Can't view/drop table with 'Temp' Prefix

Hi,

I was just testing something out and found a weird problem --

I tried to create a sample table in my main tablespace --

CREATE TABLE TempTPeakData (
"SITEID" INTEGER NOT NULL ,
"PVAL" DOUBLE NOT NULL ,
"PDATETIME" TIMESTAMP NOT NULL )
DATA CAPTURE CHANGES
IN "P_TBLSP" ;

I can create the table just fine but have issues when trying to describe/drop this table... I keep getting this message :

Column Type Type
name schema name Length Scale Nulls
------------------------------ --------- ------------------ -------- ----- ------

0 record(s) selected.

SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a
query is an empty table. SQLSTATE=02000


If I give.. db2 "list tables", I see the table name in the list. Am I getting this error because the table is a mix of lowercase/uppercase letters? If so, how can I drop it? Also, if I use the All Caps version as the table name, I don't have any issues at all...thanks!

Last edited by db2user; 09-22-08 at 18:46.
Reply With Quote
  #2 (permalink)  
Old 09-23-08, 01:46
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
if the tablename consists of upper- and lowercase character, put it into double quotes.
e.g.
DROP TABLE "TempTPeakData" ;
Reply With Quote
  #3 (permalink)  
Old 09-23-08, 02:13
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
thanks much...i will try it out!
Reply With Quote
  #4 (permalink)  
Old 09-23-08, 08:14
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
To avoid guesswork, try this:
Code:
select tabschema, tabname from syscat.tables where lower(tabname) = 'temptpeakdata'
Reply With Quote
  #5 (permalink)  
Old 09-23-08, 13:23
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
great thanks! btw..umayer.. the command you gave worked..
Reply With Quote
  #6 (permalink)  
Old 09-23-08, 13:41
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You should probably drop and recreate the table with a case insensitive name. Otherwise you are likely to lynched by a mob of angry developers and fellow DBA's.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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