How to truncate all user tables?

前端 未结 5 2456
抹茶落季
抹茶落季 2021-02-19 08:01

How can I truncate all user table in oracle? I have problem with tables constraints.

5条回答
  •  粉色の甜心
    2021-02-19 08:26

    You can output, then execute the one you like:

    set serveroutput on;
    
    begin
    
    for r in (select table_name from user_tables) loop
    
        dbms_output.put_line('truncate table ' || r.table_name);
    
      end loop;
    
    end;
    

提交回复
热议问题