views:

519

answers:

2

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?

+3  A: 
Michael Sharek
Agreed. If you had the DDS for the file, you could insert the field in the DDS and then use a CHGPF command. Or you could create the new table in SQL and copy the data using CPYF with FMTOPT(*MAP *DROP).
Tracy Probst
I have a feeling you are right but I am just hoping someone knows a super secret easy and safe way to do this...
larson4
+1  A: 

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

ALTER TABLE table ADD COLUMN colname ... BEFORE othercolumn

david