I'm working on DB2 v7.2 on windows 2000 server.
I'm trying to run a sql -
insert into table tab1 (col1, col2, col3) values (Select col1, col2, col3 from tab2)
which is not working. Gives the error
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL0412N Multiple columns are returned from a subquery that is allowed only
one column. SQLSTATE=42823.
Stragely though, if I give a sql
insert into table tab1 (col1, col2, col3) (Select a1, a2, a3 from tab2)
It works perfectly.
When looking at the syntax rules, the first sql is right and this one is wrong.
I dont know why it is behaving in this way.
Please let me know if you've any comments on this.