这样的脚本比较难
我们要从一个表,假如这个表是catalog从它找到table type 为"sys"的表,
catalog 包括字段 table type 和table name 然后根据找出来的每个表,再把每一个表中数据都转化成为一个字符串:
"insert into tablename values (.......)"
并且写到一个文件中. 最后得到一系列insert into tablename values (.......)要求只能使用PL/SQL脚本,不能用其他工具(toad,pl/SQL developer等)
我们要从一个表,假如这个表是catalog从它找到table type 为"sys"的表,
catalog 包括字段 table type 和table name 然后根据找出来的每个表,再把每一个表中数据都转化成为一个字符串:
"insert into tablename values (.......)"
并且写到一个文件中. 最后得到一系列insert into tablename values (.......)要求只能使用PL/SQL脚本,不能用其他工具(toad,pl/SQL developer等)
as
cursor t_sor is
select table_name,column_name from col where table_name=p_table;
begin
for v_sor in t_sor loop
if v_sor.table_name=p_table then
str:='insert into '||tablename||' values ('||c......);
...
end if;
end;
/