I am relatively new to SQL and would appreciate your insight on formulated the following statement.
I have two tables representing the header (ek2122) and detail items (ek2124) of a purchase order. I would like to update a value in the details based on a join between the two tables. Here is what I have so far but I don't think Pervasive 8.5 handles "WHERE EXISTS" well in an UPDATE statement. The syntax is correct but the statement never completes.
Your help is greatly appreciated.
I have two tables representing the header (ek2122) and detail items (ek2124) of a purchase order. I would like to update a value in the details based on a join between the two tables. Here is what I have so far but I don't think Pervasive 8.5 handles "WHERE EXISTS" well in an UPDATE statement. The syntax is correct but the statement never completes.
Code:
update ek2122
set ek2122_lager = '2362'
where exists
(select * from ek2122
inner join ek2124
on ek2122_bs_nr = ek2124_bs_nr
where ek2124_ret_grund = '100'
and ek2122_lager = '2360')
Your help is greatly appreciated.