Unix Technical Forum

How to drop an index named as "XPKsp_prj_stk_ord_"?

This is a discussion on How to drop an index named as "XPKsp_prj_stk_ord_"? within the DB2 forums, part of the Database Server Software category; --> Hi, I have a table creation script that generated by ERWin. An index name is too long and has ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:33 AM
Challenge
 
Posts: n/a
Default How to drop an index named as "XPKsp_prj_stk_ord_"?

Hi,

I have a table creation script that generated by ERWin. An index name
is too long and has been truncated as "XPKsp_prj_stk_ord_". Now I want
to drop and recreate it as another name. I got error when I drop it:

SQL0204N "SPARADM.XPKsp_prj_stk_ord_" is an undefined name.
SQLSTATE=42704

How can I drop it?

Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:33 AM
Rhino
 
Posts: n/a
Default Re: How to drop an index named as "XPKsp_prj_stk_ord_"?


"Challenge" <hanna_shaw@yahoo.com> wrote in message
news:1152032487.734615.158130@m79g2000cwm.googlegr oups.com...
> Hi,
>
> I have a table creation script that generated by ERWin. An index name
> is too long and has been truncated as "XPKsp_prj_stk_ord_". Now I want
> to drop and recreate it as another name. I got error when I drop it:
>
> SQL0204N "SPARADM.XPKsp_prj_stk_ord_" is an undefined name.
> SQLSTATE=42704
>
> How can I drop it?
>


I've never used ERWin but shouldn't the DB2 Control Center be able to drop
the index? Just list all the indexes for the table, then use the GUI to
delete that specific index.

Or do you absolutely have to know how to drop it through ERWin?

--
Rhino


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 07:33 AM
m
 
Posts: n/a
Default Re: How to drop an index named as "XPKsp_prj_stk_ord_"?

Challenge wrote:
> Hi,
>
> I have a table creation script that generated by ERWin. An index name
> is too long and has been truncated as "XPKsp_prj_stk_ord_". Now I want
> to drop and recreate it as another name. I got error when I drop it:
>
> SQL0204N "SPARADM.XPKsp_prj_stk_ord_" is an undefined name.
> SQLSTATE=42704
>
> How can I drop it?
>
> Thanks.
>

DB2 attempts to put everyting in uppercase at the command line. The drop
command needs to be DROP INDEX SPARADM."XPKsp_prj_stk_ord_" - note the
QUOTES...

M
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 07:33 AM
Gregor =?UTF-8?B?S292YcSN?=
 
Posts: n/a
Default Re: How to drop an index named as "XPKsp_prj_stk_ord_"?

m wrote:

> Challenge wrote:
>> Hi,
>>
>> I have a table creation script that generated by ERWin. An index name
>> is too long and has been truncated as "XPKsp_prj_stk_ord_". Now I want
>> to drop and recreate it as another name. I got error when I drop it:
>>
>> SQL0204N "SPARADM.XPKsp_prj_stk_ord_" is an undefined name.
>> SQLSTATE=42704
>>
>> How can I drop it?
>>
>> Thanks.
>>

> DB2 attempts to put everyting in uppercase at the command line. The drop
> command needs to be DROP INDEX SPARADM."XPKsp_prj_stk_ord_" - note the
> QUOTES...
>
> M


Any if you are not sure about the name of the index do this:
SELECT INDNAME FROM SYSCAT.INDEXES WHERE TABNAME = 'YOUR_TABLE_NAME'

Best regards,
Kovi
--
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
| Gregor Kovac | Gregor.Kovac@mikropis.si |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| In A World Without Fences Who Needs Gates? |
| Experience Linux. |
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com