By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,851 Members | 1,752 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,851 IT Pros & Developers. It's quick & easy.

Drop column from table

P: n/a
How can I drop a column from an existing table:

CREATE TABLE table1 (column1 integer, column2 integer)

succeeds.

ALTER TABLE table1 DROP COLUMN column2

turns into an error "Error: [IBM][iSeries Access ODBC Driver]Operation
cancelled."

Specs:
- Database: DB2-database/ IBM OS400
- SQL Interface: Client Access ODBC Driver, version 9.00.07.00

Greetings, Twan Kennis
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I'm not familiar with DB2/400 but I think drop colum is also not
supported as that of UDB. have you check the sql referece?

Nov 12 '05 #2

P: n/a
ya there is no command to drop the column and we cannot trunacte the
data of the table also for that u have to recreate the table with the
required columns

Nov 12 '05 #3

P: n/a
You should be able to if you have ALTER privileage

http://publib.boulder.ibm.com/html/a...fzmstatabl.htm

Nov 12 '05 #4

P: n/a
Hello.

DB2/400 does support dropping a column but some strange way.
If you invoke this command from strsql utility (from 5250 terminal
window) you will notice, that it asks you something "are you sure you
really want to do this?" and will wait for your input. After you type
'I" symbol it will drop your column.
Since you can't invoke interactive sql commands from iSeries client
window, you can't successfully invoke this command from this window.
May be there is some way to adjust OS400 to invoke immediately dropping
a column without confirmation, but I don't know it...

Sincerely,
Mark B.

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.