Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DROP TABLE

Posted on 2006-07-21
5
Medium Priority
?
868 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 200 total points
ID: 17185297
ALTER TABLE T ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE;
COMMIT;
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

972 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