-- 按照时间条件 declare -- Local variables here v_stat VARCHAR2(100) := 'to_date(''2011-12-28'',''yyyy-mm-dd'')'; cursor mycur is select 'DELETE FROM ' || table_name || ' where stat_time < ' || v_stat || ';' go from user_tables; tableinfo VARCHAR2(100); trunTab VARCHAR2(150); BEGIN FOR tableinfo IN mycur LOOP trunTab := tableinfo.go; -- dbms_output.put_line(trunTab); EXECUTE IMMEDIATE trunTab; END LOOP; COMMIT; end;