On 06 Mar 2013 13:18, Voris, John wrote:
On 06 Mar 2013 08:01, CRPence wrote:
<<SNIP>> However generically, the SQL INSERT is not conducive to
effect the FMTOPT(*MAP) because the data is inserted by column
positions rather than by column names
This got me thinking. I do not recall seeing anything in the Paul
Conte SQL book relative to this.
But after one does a field mapping, is it allowed to do a load in
SQL by column number ?
Could one do something like . . .
INSERT into NEW_FILE
SELECT 1,2,4,7 FROM OLD_FILE
. . . I expect that it is bad form, but does SQL tolerate it ?
The SQL can tolerate that [with effective DECFMT(*PERIOD)], but
probably not producing the desired effect.
Column numbers are not a feature of the select-list; ¿only? the ORDER
BY allows that effective capability. Instead, the subselect considers
each of those comma-separated values as literal\constant expressions;
however with the dilemma for, when running where comma is decimal
separator, to decide whether that might be the equivalent of values(1.2,
4.7) or values(1, 2, 4, 7) or perhaps even values(1, 2.4, 7) to be
selected for every row of OLD_FILE.