Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DROP TABLE

Posted on 2006-07-21
5
831 Views
Last Modified: 2011-10-03
I HAVE A TABLE AND SOME MQT'S ARE RELATED TO THT TABLE
I WANT TO DROP THE TABLE AND RECREATE THE SAME TABLE ALL SAME COLUMNS
SAME DATATYPE BUT DONT WANNA DROP MQT ASSOCIATED TO IT
CAN I DO IT ?
THANKS
bobby
0
Comment
Question by:bobby2929
5 Comments
 
LVL 7

Expert Comment

by:sachinwadhwa
ID: 17155532
no, you have to recreate MQTs. If you drop table, your MQTs will be marked invaild.

use db2look command to extract DDL of MQTs before dropping tables.
0
 
LVL 2

Expert Comment

by:srielau
ID: 17170052
You can ALTER teh MQT to DROP the query. Thus you have them decoupled.
Later on you can ALTER ADD the query back in.

Cheers
Serge
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 17181883
why drop the table...?

can you not just "truncate" it  with a Load Null or alter table ... activate not logged initially .. the with empty(?) option


sorry haven't got the exaft syntax to hand...

which version and platform of db2/udb are you using?
0
 

Author Comment

by:bobby2929
ID: 17185153
i am on version 8.2 platform NT
can we truncate table i thought truncate is not supported in db2  , i cant delete tht table
as it has like 17 mill rows , if sumone can post truncate command it will be great
thanks
bobby


0
 
LVL 2

Accepted Solution

by:
srielau earned 50 total points
ID: 17185297
ALTER TABLE T ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
COMMIT;
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question