Subject Re: [ib-support] UPDATE problem
Author Svein Erling Tysvaer
At 11:20 02.06.2003 +0000, you wrote:
>UPDATE product P
>SET P.stock = (select T.stock from temp T
> where P.id = T.product_id) ;
>
>Is the statment is trying to update stock in table product
>with null values for products which does not exist in table
>temp ? If it is, is there a work around ?

Yes and yes. Correct syntax is

UPDATE product P
SET P.stock = (select T.stock from temp T
where P.id = T.product_id) ;
where exists(select 1 from temp t2 where p.id = t2.product_id)

HTH,
Set