如何删除oracle数据库中所有表里的数据?
表的数量较多。一个一个删除是不现实的。
表的数量较多。一个一个删除是不现实的。
解决方案 »
- 同机子跨数据库导入的问题。
- PLS-00103: Encountered the symbol "CREATE" when expecting one of the following:
- 求几本oracle的书?
- 求助,关于日期间隔的存储过程如何写
- 急救!!oracle数据库中所有表中数据导入DB2数据库相应的表中?
- 请问存储过程的一个参数的返回值是数组,怎么写?
- 如何在unix下安装oracle的客户端?
- 如何快速学习Oracle
- 安装Oracle8.1.7的过程中,在配置 Net8的监听时,长时间没有响应,这是怎么回事??
- 用sql_plus查询,如何把查询结果输出到一个excel文件?
- 从数据库中读取日期类型数据的问题
- 视图中为何不能同时用order by 与 with read only?
SQL> create or replace procedure truncate_all_table
2 as
3 l_str varchar2(1000);
4 begin
5 for x in (select tname from tab where tabtype='TABLE') loop
6 l_str:='truncate table '||x.tname;
7 execute immediate l_str;
8 end loop;
9 end;
10 /过程已创建。
execute truncate_all_table;
set pagesize 1000
select 'truncate table '||tname||';' from tab where tabtype = 'TABLE';
spool off
@c:\aa.txt