简体   繁体   English

如何在AIX上删除DB2中的多个列?

[英]How can I drop multiple columns in DB2 on AIX?

What is the syntax to drop multiple columns in DB2? 删除DB2中的多个列的语法是什么? I tried this: 我试过这个:

ALTER TABLE work_item DROP COLUMN (TRANSACTION_TYPE, REQUEST_TYPE, LOCATION_CODE, ROLE_ID, SUBMITTED_BY);

But it didn't work. 但它没有用。 I am running on AIX (from what I read, it looks like maybe you cannot drop columns at all on platforms other than AIX). 我在AIX上运行(根据我的阅读,看起来你可能不会在除AIX之外的平台上删除列)。

If I drop the columns one by one, it seems to work, but after the first three, I need to REORG the table. 如果我一个接一个地删除列,它似乎工作,但在前三个之后,我需要REORG表。 I want to do this in one fell swoop, with no REORG. 我想一举做到这一点,没有REORG。

Is it possible? 可能吗?

The following works for me on DB2 9.5 on Windows, but it should work on earlier versions on AIX as well: 以下适用于Windows上的DB2 9.5,但它也适用于AIX上的早期版本:

ALTER TABLE MYSCHEMA.ABC
DROP COLUMN B
DROP COLUMN C

Here's the documentation on the ALTER TABLE command 这是ALTER TABLE命令的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM