[GENERAL] insert into ... select ... and column order

2008-01-15 Thread Tore Halset
Hello. One of our users tried a insert into ... select ... that gave a strange error message. After digging into the issue, the problem seem to be that the order of the columns in the select statement must match the table definition. Here is a way to reproduce this case. -- a source

Re: [GENERAL] insert into ... select ... and column order

2008-01-15 Thread Richard Huxton
Tore Halset wrote: Hello. One of our users tried a insert into ... select ... that gave a strange error message. After digging into the issue, the problem seem to be that the order of the columns in the select statement must match the table definition. Here is a way to reproduce this case.

Re: [GENERAL] insert into ... select ... and column order

2008-01-15 Thread Albe Laurenz
Tore Halset wrote: One of our users tried a insert into ... select ... that gave a strange error message. After digging into the issue, the problem seem to be that the order of the columns in the select statement must match the table definition. Here is a way to reproduce this case.

Re: [GENERAL] insert into ... select ... and column order

2008-01-15 Thread Tore Halset
On Jan 15, 2008, at 12:16 , Albe Laurenz wrote: Because the SQL standard says so. ISO/IEC 9075-2, Chapter 14.8, Syntax Rule 9: If the insert column list is omitted, then an insert column list that identifies all columns of T in the ascending sequence of their ordinal positions within T is

Re: [GENERAL] insert into ... select ... and column order

2008-01-15 Thread Tino Wildenhain
Tore Halset wrote: Hello. One of our users tried a insert into ... select ... that gave a strange error message. After digging into the issue, the problem seem to be that the order of the columns in the select statement must match the table definition. Here is a way to reproduce this case.