输出是含该字符的表面,字段名和出现次数。
declare
v_count number;
v_string varchar2(1000);
cursor cur_scan is
select table_name, column_name, data_type
from all_tab_columns
where wner = 'GPD03';
begin
DBMS_OUTPUT.ENABLE (2000000);
for rec_scan in cur_scan
Loop
if rec_scan.data_type = 'VARCHAR2'
then
v_string := 'select count(1) from ' || rec_scan.table_name || ' where ' || rec_scan.column_name || ' = ''EUROPE-FORMULAS''';
EXECUTE IMMEDIATE v_string into v_count;
if v_count > 0 then
dbms_output.put_line (v_string );
dbms_output.put_line (v_count );
end if;
end if;
end loop;
exception
when others then
dbms_output.put_line ( SQLERRM );
end;
|Archiver|小黑屋|手机版|壹佰网 ERP100
( 京ICP备19053597号-2 )
GMT+8, 2025/11/30 03:27 , Processed in 0.007771 second(s), 12 queries , File On.
Powered by Discuz! X3.4
Copyright © 2001-2020, Tencent Cloud.