Alter Table Drop Column error
When running the sql command: ALTER TABLE mylib/mytable DROP COLUMN mycolumn, I continually receive the SQL Error SQL0952. Everything that I have found indicates that I should be able to DROP COLUMN with no problems, but the only way I could get this to work for me was the following solution:
iSeries Commnad - ADDRPYLE SEQNBR(1500) MSGID(CPA32B2) RPY(I)
Then with my script, I include:
With any script that I want to "drop column", I am needing to include the CHGJOB command. We are on version V6R1 with our iSeries, is this really the way I need to be dropping columns with sql?? I have tested the drop columns on tables with & without data, in both cases, I receive the SQL0952 error.
Any suggestions will be appreciated!!
Maybe you could change the default message reply to 'I' instead of 'C' like our system shows...???
Message ID . . . . . . . . . : CPA32B2
Message file . . . . . . . . : QCPFMSG
Library . . . . . . . . . : QSYS
Default reply . . . . . . . : C
CCSID . . . . . . . . . . . : 65535
I did this, but still when running any "drop" statement, I have to include the CHGJOB command or the statement will error:
I'm just not understanding why the "drop" statement without having to "change the default message reply to 'I' instead of 'C' " and then also add the CHGJOB command before the ALTER TABLE.
Thanks for your reply!
DMM...Follow T. Snyder's thread about using embedded SQL and exception handling (forthcoming) that you can do within embedded SQL that may be what you're looking for. Meantime...lookup the WHENEVER statement in your current v?r? SQL reference for a jump start on the topic. Good Luck!