Add a column to a DB2/400 table with a specific ordinal position

jwl picture jwl · Oct 20, 2009 · Viewed 16.2k times · Source

Is there an SQL command on the AS400/iSeries/System-i/whatever to add a column to a table in a specific ordinal position, or moving an existing column to a different position?

Answer

David G picture David G · Jun 3, 2010

IBM i 7.1 now allows you to add a column in front of another.

ALTER TABLE table ADD COLUMN colname ... BEFORE othercolumn