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: additional condition of update in merge

Re: additional condition of update in merge

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Thu, 10 Mar 2005 20:30:34 -0800
Message-ID: <1110515238.336169@yasure>


cschang wrote:

> DA Morgan wrote:
> 

>> cschang wrote:
>>
>>> I tried to learn the merge, so i tried this in a procedure however,
>>> it gave me an error
>>> MERGE INTO ORDER_STATUS_NOTIFICATION o1
>>> USING ( SELECT COUNT(*) v_count
>>> FROM ORDER_STATUS_NOTIFICATION
>>> WHERE CHECKOUT_TXN_ID = strCheckoutTxnID ) o2
>>> ON ( o2.v_count > 0)
>>> WHEN MATCHED THEN
>>> UPDATE
>>> SET
>>> EVENT_TYPE = 'FAILED',
>>> DATE_OF_EVENT = SYSDATE
>>> WHERE EVENT_TYPE <> 'FAILED' <-- Err: ORA-00905,
>>> Missing Keyword
>>> WHEN NOT MATCHED THEN
>>> INSERT
>>> (
>>> CHECKOUT_TXN_ID,
>>> EVENT_TYPE
>>> )
>>> VALUES
>>> (
>>> strCheckoutTxnID,
>>> 'FAILED'
>>> );
>>>
>>> Does that mean I can not add additional where condition for the
>>> update section? I was running this on 9.2 version.
>>>
>>> C Chang
>>
>>
>>
>> You need to post the actual error message since none of us have your
>> tables so we can't try it out.
> 
> I believed I point out the place where Oracle reveal the error and the 
> message  with the SQLCODE.  Please read carefully.

You did and it is meaningless. Many ORA- messages have different text in different situations that are critical to debugging. If you want help you need to put in the effort. Hopefully the answer someone else gave you suffices.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Thu Mar 10 2005 - 22:30:34 CST

Original text of this message

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