oracle全库查找是否有某个值

Posted 借你耳朵说爱你

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle全库查找是否有某个值相关的知识,希望对你有一定的参考价值。

在scott用户下面,搜索含有‘要找的值‘的数据的表和字段穷举法:

declare
  v_Sql   varchar2(2000);
  v_count number;
begin
  for xx in (select t.OWNER, t.TABLE_NAME, t.COLUMN_NAME from dba_tab_columns t where t.OWNER = scott) loop
    begin
      v_Sql := select count(1) from  || xx.owner || . || xx.table_name || where  || xx.column_name ||  like ‘‘%要找的值%‘‘ ;
      execute immediate v_Sql
        into v_count;
      if (v_count >= 1) then
        dbms_output.put_line(xx.table_name || : || xx.column_name);
      end if;
    exception
      when others then
        null;
    end;
  end loop;
end;

 

以上是关于oracle全库查找是否有某个值的主要内容,如果未能解决你的问题,请参考以下文章

SQL Server全库搜索(在所有表中查找内容)

js如何查找数组中是不是存在某个值

js如何查找数组中是不是存在某个值

js如何查找数组中是不是存在某个值

Oracle如何查询字符串中是不是含有

快速查找某个值是不是存在于 C 数组中?