Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: update tablexx from
There is a "slight" problem with all the examples, and your example: Every
row in bcd will be updated to the same cusomer_nm. So, you need to narrow
the query down on bcd to a row. that is unless you want to update every
row.
--
Robert P. Lockard
rob_at_oraclewizard.com
www.oraclewizard.com will be online soon.
"slightly" flawed examples.
update bcd
set cust_name =
(select customer_nm
from dr11_order_temp
where customer_nm=synnex);
or
define name='synnes'
declare
cursor c1 is
select customer_nm
from dr11_order_tmp
where customer_nm=&synnex;
begin
for rec in c1
loop
update bcd
set cust_name = rec.customer_nm;
end loop;
end;
> update bcd
> set set b.cust_name=dr11.customer_nm
> from bcd b, dr11_order_tmp dr11
> where dr11.customer_nm='synnex
"Maggie" <maggiezhou_at_hotmail.com> wrote in message
news:8b6idc$jh$1_at_web1.cup.hp.com...
> I ran the query but
> update bcd
> set set b.cust_name=dr11.customer_nm
> from bcd b, dr11_order_tmp dr11
> where dr11.customer_nm='synnex
>
> But I got
> SQL> /
> from bcd b,dr11_orders_tmp dr11
> *
> ERROR at line 3:
> ORA-00933: SQL command not properly ended
>
> ------
> Is there " from " after set in update in Oracle?
>
>
Received on Mon Mar 20 2000 - 19:52:21 CST