MIDRANGE dot COM Mailing List Archive



MIDRANGE-L » March 2013

Re: SQL INSERT FMTOPT(*MAP *DROP)



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.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2013 by MIDRANGE dot 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 here. If you have questions about this, please contact