![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
Duh! I found the answer. I cannot specify "VALUES". I should have written: insert into table2 (fld1, fld2, fld3) (select fld1, fld2, fld3 from table1 where blah) |
#22
| |||
| |||
|
|
sheldonlg schrieb: Duh! I found the answer. I cannot specify "VALUES". I should have written: insert into table2 (fld1, fld2, fld3) (select fld1, fld2, fld3 from table1 where blah) I am glad, you solved your problem, but maybe you will be interested to notice, that similar semantics ( with values clause ) is possible for multitable insert ( that can operate on one table as well) - something like create table emp_short as select ename,empno from emp where 1=2 ; insert all into emp_short(ename,empno) values(ename,empno) select * from emp ; http://download.oracle.com/docs/cd/B...4.htm#i2095116 Best regards Maxim |
#23
| |||
| |||
|
|
sheldonlg schrieb: Duh! I found the answer. I cannot specify "VALUES". I should have written: insert into table2 (fld1, fld2, fld3) (select fld1, fld2, fld3 from table1 where blah) I am glad, you solved your problem, but maybe you will be interested to notice, that similar semantics ( with values clause ) is possible for multitable insert ( that can operate on one table as well) - something like create table emp_short as select ename,empno from emp where 1=2 ; insert all into emp_short(ename,empno) values(ename,empno) select * from emp ; http://download.oracle.com/docs/cd/B...4.htm#i2095116 Best regards Maxim |
#24
| |||
| |||
|
|
sheldonlg schrieb: Duh! I found the answer. I cannot specify "VALUES". I should have written: insert into table2 (fld1, fld2, fld3) (select fld1, fld2, fld3 from table1 where blah) I am glad, you solved your problem, but maybe you will be interested to notice, that similar semantics ( with values clause ) is possible for multitable insert ( that can operate on one table as well) - something like create table emp_short as select ename,empno from emp where 1=2 ; insert all into emp_short(ename,empno) values(ename,empno) select * from emp ; http://download.oracle.com/docs/cd/B...4.htm#i2095116 Best regards Maxim |
#25
| |||
| |||
|
|
sheldonlg schrieb: Duh! I found the answer. I cannot specify "VALUES". I should have written: insert into table2 (fld1, fld2, fld3) (select fld1, fld2, fld3 from table1 where blah) I am glad, you solved your problem, but maybe you will be interested to notice, that similar semantics ( with values clause ) is possible for multitable insert ( that can operate on one table as well) - something like create table emp_short as select ename,empno from emp where 1=2 ; insert all into emp_short(ename,empno) values(ename,empno) select * from emp ; http://download.oracle.com/docs/cd/B...4.htm#i2095116 Best regards Maxim |
![]() |
| Thread Tools | |
| Display Modes | |
| |