Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00936: missing expression
ORA-00936: missing expression [message #227013] Tue, 27 March 2007 02:28 Go to next message
rdhaprakasam
Messages: 37
Registered: February 2007
Location: Coimbatore
Member

hi friends,
i am trying to insert the values from one table to another table.. but
insert into truck.emp2 values (select empno,empname from ship.empmain);
here truck and ship are different schema name which are belongs in oradb database.

It show the following error ..please help me..

ORA-00936: missing expression

emp2 has two fields no and name..
empmain has many fields such as empno,empname etc

thanks in advance..
Re: ORA-00936: missing expression [message #227018 is a reply to message #227013] Tue, 27 March 2007 02:42 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

You either:
  • insert values ...
  • insert select ...

But not not "insert values select".

Regards
Michel

Re: ORA-00936: missing expression [message #227167 is a reply to message #227018] Tue, 27 March 2007 08:14 Go to previous messageGo to next message
seraphstream
Messages: 8
Registered: March 2007
Junior Member
You must use this syntax:

insert into table1 (col1, col2, coln) select coln1, coln2, colnn from table2;

see also:

ORA-00936

or

ORACLE FORUM

Razz Razz


icon14.gif  Re: ORA-00936: missing expression [message #227317 is a reply to message #227167] Wed, 28 March 2007 00:09 Go to previous message
rdhaprakasam
Messages: 37
Registered: February 2007
Location: Coimbatore
Member

thanks guys it`s working nicely..
Previous Topic: extracting information from 2 different tables
Next Topic: general query required
Goto Forum:
  


Current Time: Thu Dec 05 06:21:15 CST 2024