Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Error on Insert with Select

Re: Error on Insert with Select

From: Dana Reed <danareed_at_oro.net>
Date: Thu, 29 Jul 1999 10:40:03 -0700
Message-ID: <37A091F3.F4176442@oro.net>


To start with, use parenthesis only when necessary; don't use them in select column lists, for example. This is probably the source of your problem. Furthermore, use IN in the where clause to simplify:

    where division in ('EXPORT', 'SUBSIDIARY' , 'SAMPLES');

The general format should be:

    insert into <table1> (<columns1>)
    (select <columns2> from <table2>
    where <where clause>);

abrusko wrote:

> Hi,
>
> Can anyone please tell me what is wrong with the syntax of
> this query...I am getting the following error:
> ORA-00907: missing right parenthesis
>
> Insert into Frt.Freight
> (pro, frt_order, carrier, accrued, shipfrom, shipdate,
> shipto, customer, division, code, weight, value, cust_po,
> pc, cases, city, shippoint, pallets, bl, whse, cube,
> reldate, month, year, state, frt_mode)
> (Select (pro, frt_order, carrier, accrued, shipfrom,
> shipdate, shipto, customer, division, code, weight, value,
> cust_po, pc, cases, city, shippoint, pallets, bl, whse,
> cube, reldate, month, year, state, frt_mode)
> from Frt.Sardown
> where (division = 'EXPORT' or division = 'SUBSIDIARY' or
> division = 'SAMPLES'));
>
> Thank you!
> Andy
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
Received on Thu Jul 29 1999 - 12:40:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US