× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 29-Mar-2012 10:30 , Jerry C. Adams wrote:
I suppose, first, a CRTDUPOBJ and then an Alter Table, such as:

ALTER TABLE LISTCONS
ADD ABNSTK CHAR(1) CCSID 37 NOT NULL WITH DEFAULT ;
LABEL ON <<SNIP>>

This adds the field at the end; personally, I rarely use Alter Table
so I don't know if one could actually insert a field (column) at
another relative location.


CHGPF SRCFILE(specified) had allowed change in ordinal position of fields.

With IBM i v7r1 SQL there is a BEFORE column-name [sub]clause to effect similar, but only for the ADD COLUMN clause:

http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/topic/db2/rbafzatabl.htm
IBM i 7.1 Information Center -> Database -> Reference -> SQL reference -> Statements
_i ALTER TABLE i_
"The ALTER TABLE statement alters the definition of a table.
...
_i BEFORE column-nameEnd of change i_
Identifies the column before which the new column is added. The name must not be qualified and must identify an existing column in the table. If the BEFORE clause is not specified, the column is added at the end of the row.
...
"

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.