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

Home -> Community -> Usenet -> c.d.o.server -> Re: Update error...!

Re: Update error...!

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Mon, 19 Nov 2007 11:43:12 +0100
Message-ID: <474168C0.4070306@gmail.com>


pal schrieb:
> UPDATE paywork
> SET ot1_hrs = 0,
> ot1_amount = 0,
> ot2_hrs = 0,
> ot2_amount= 0,
> ot3_hrs= 0,
> FROM paywork,
> emp_master
> WHERE ( paywork.emp_code = emp_master.emp_code ) AND
> ( emp_master.loc_cd like :is_loc_cd ) ;
>
>
> this code is giving me error..
>
> Whether i can use "From" in an update query? cos SQL plus is giving
> an error message on that,
>
> if i'm not using the from i cant check the condition on where clause.
>
> Can any one tell me what i can do for this

Probably, something like this should work for you:

UPDATE paywork p

SET ot1_hrs = 0,
    ot1_amount = 0,
    ot2_hrs = 0,
    ot2_amount= 0,
    ot3_hrs= 0

WHERE EXISTS (
   SELECT null
   FROM emp_master e
   WHERE ( p.emp_code = e.emp_code )
   AND ( e.loc_cd like :is_loc_cd )
)

UPDATE syntax can be looked at
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10007.htm#i2067715

Best regards

Maxim Received on Mon Nov 19 2007 - 04:43:12 CST

Original text of this message

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