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: Another newbie question about UPDATE

Re: Another newbie question about UPDATE

From: Gerard H. Pille <ghp_at_skynet.be>
Date: Thu, 26 May 2005 21:57:34 +0200
Message-ID: <42962A2E.4080704@skynet.be>


Ed Prochak wrote:

> 
> Ole Hansen wrote:
> 

>>Hi !
>>
>>Another question from this stupid danish oracle-newbie :-)
>>
>>I have 2 tables, STOCKTABLE and STOCKTABLE_EXT
>>
>>I want to update 2 fields in STOCKTABLE, with the values of 2 fields
>>in STOCKTABLE_EXT.
>>
> 
> []
> 

>>I have tried:
>>
>>UPDATE STOCKTABLE st
>> SET (st.ItemName, st.ItemGroup) =
>> (SELECT ste.ItemName, ste.ItemGroup
>> FROM STOCKTABLE_EXT ste
>> WHERE st.itemnumber = ste.itemnumber)
>>
>>But i get an ORA-01407 "Cannot update STOCKTABLE.ItemName to NULL".
>>
>>So obviously there is something wrong with my statement. What am i
>>doing wrong ?
> 
> 
> Given that error message why do you think the problem is in your
> statement? I would first look in the data. Is there a row (or many) in
> STOCKTABLE_EXT that has a NULL ItemName??
> 
> Ed
> Two proverbs:
> 1. Sometimes it doesn't pay to overlook the obvious.
> 2. Know your data.
> 

LOL
would it not be that there are rows in STOCKTABLE without data in STOCKTABLE_EXT?

He should have kept his where-clause from his first try. Received on Thu May 26 2005 - 14:57:34 CDT

Original text of this message

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