CREATE OR REPLACE PROCEDURE spAtualizaViewsMat IS V_NAME VARCHAR(100); V_CMD VARCHAR(1000); CURSOR TAB IS SELECT mview_name FROM all_mviews WHERE OWNER = 'RM'; BEGIN OPEN TAB; FETCH TAB INTO V_NAME; LOOP EXIT WHEN TAB%NOTFOUND; V_CMD := 'BEGIN DBMS_MVIEW.REFRESH (:mview_name); END;'; EXECUTE IMMEDIATE (V_CMD) USING V_NAME; FETCH TAB INTO V_NAME; END LOOP; CLOSE TAB; END; / BEGIN spAtualizaViewsMat; END;