I want to loop inside an UPDATE statement. Is it possible to do so? Its is giving me an error in "rec" variable. If not can you show me how I can do it. This is my code where I try to do a SELECT in order to update all the rows with all the variables.
BEGIN
UPDATE DATMCCN0
SET E_NOME = (
FOR rec IN(SELECT IID FROM DATMCCN0)
LOOP
SELECT I_NOME FROM DAT_CCNCONFIG0 INNER
JOIN DATMCCN0 ON DAT_CCNCONFIG0.I_NOME = DATMCCN0.CAPLIC
where DATMCCN0.IID = rec.IID)
END LOOP;
END;
See Question&Answers more detail:os