hi,
follow the steps to drop a column in a table.
1)
C:\>db2 describe table nu
Column Type Type
name schema name Length Scale
Nulls
------------------------------ --------- ------------------ -------- -----
------
ID SYSIBM SMALLINT 2 0
Yes
NAME SYSIBM VARCHAR 15 0
Yes
SALARY SYSIBM BIGINT 8 0
Yes
DEPT SYSIBM VARCHAR 10 0
Yes
4 record(s) selected.
--------------------------------------------------> now i am going to drop
columns salary & dept, so for that i am creating recreating a table "drop"
2)
create table drop (id smallint, name varchar(15)) ------->without the
column you want to drop
3)
C:\>db2 insert into drop (select id, name from nu)
DB20000I The SQL command completed successfully.
4) db2 drop table nu
5) db2 rename table drop to nu
Thanks & Regards,
Prabhakar.
DB2 & UDB email list listserv db2-l LazyDBA home page