dbTalk Databases Forums  

trouble with insert

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss trouble with insert in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
Maxim Demenko
 
Posts: n/a

Default Re: trouble with insert - 07-13-2008 , 09:08 AM






sheldonlg schrieb:
Quote:
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


Reply With Quote
  #22  
Old   
sheldonlg
 
Posts: n/a

Default Re: trouble with insert - 07-13-2008 , 10:14 AM






Maxim Demenko wrote:
Quote:
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
Thank you. That is very interesting.


Reply With Quote
  #23  
Old   
sheldonlg
 
Posts: n/a

Default Re: trouble with insert - 07-13-2008 , 10:14 AM



Maxim Demenko wrote:
Quote:
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
Thank you. That is very interesting.


Reply With Quote
  #24  
Old   
sheldonlg
 
Posts: n/a

Default Re: trouble with insert - 07-13-2008 , 10:14 AM



Maxim Demenko wrote:
Quote:
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
Thank you. That is very interesting.


Reply With Quote
  #25  
Old   
sheldonlg
 
Posts: n/a

Default Re: trouble with insert - 07-13-2008 , 10:14 AM



Maxim Demenko wrote:
Quote:
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
Thank you. That is very interesting.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.