Re: SQL problem - SOS!
Posted in 1999
jim lowry — — source: Informix-list mailing list archive (1991-1998)
Peter Neville wrote: > > I have to update a record by adding a number to a field within the same > record. Unfortunately, Informix SE informs me that I cannot modify a table > that is being used in a sub-query. > Can anyone suggest a workaround to this that does not require storing the > value in a temporary table or using a variable within another language. > Below is an example of the code I am using: - > > update stockm > set back_order_qty = > (select back_order_qty > + 1 > from > stockm > where product = 'WH5204' > and warehouse = '02') > where product = 'WH5204' and warehouse = '02' > > Thanks. Put the infor. into a temp var... then update from the temp.