Bạn chỉ cần truy vấn kiểu dữ liệu "NUMBER" có đủ không?
set serveroutput on;
Declare
match_count Number :=0;
v_from NUMBER(19) :=2019030651;
CURSOR s is
(SELECT owner, table_name, column_name
FROM ALL_TAB_COLUMNS
where data_type = 'NUMBER' and
owner LIKE 'SOMETHING_%'
);
begin
for t in s LOOP
begin
EXECUTE IMMEDIATE 'SELECT count(*) FROM '||t.owner || '.' || t.table_name|| ' WHERE '||t.column_name||' LIKE :1' INTO match_count USING v_from;
IF match_count > 0 THEN
dbms_output.put_line( t.table_name ||' '||t.column_name||' '||match_count );
END IF;
end;
END LOOP;
end;