---恢复内容开始---

大家在想看看数据库中有哪些数据表中,哪些字段中有“helloworld” 这个字符串,现在数据库所有的表,视图都不能直接提供,所有必须通过循环去访问所有的数据表,所有的字段列,然后去访问所有的字段名。sql 如下:

declare
v_Sql varchar2(2000);
v_count number;
begin
for xx in (select t.TABLE_NAME, t.COLUMN_NAME
from user_tab_cols t ) loop
begin
v_Sql := 'select count(*) from ' ||xx.table_name ||
' where ' || xx.column_name || ' like ''%helloworld%'' ';
execute immediate v_Sql into v_count;
if (v_count >= 1) then
dbms_output.put_line('找到了结果'||xx.table_name || ':' || xx.column_name||'共'||v_count||'条');
end if;
exception
when others then
null;
end;
end loop;
dbms_output.put_line('ok');
end;

ok。

最新文章

  1. OOM killer
  2. Converter转换器使用
  3. R12将银行和分行都使用TCA管理
  4. tomcat下运行多个项目
  5. sqlserver2008 R2 创建作业(定时任务)
  6. Project中分清楚挣值项
  7. lintcode:交错正负数
  8. JS单元测试框架:QUnit
  9. compser 执行命令提示do not run composer as root/super !
  10. AOP概念
  11. 11427 - Expect the Expected(概率期望)
  12. hibernate 多对多 最佳实践
  13. Broken Keyboard(悲剧文本)
  14. 老李分享:Python开发性能测试脚本
  15. numpy 数组索引数组
  16. Mybatis框架可视化(1)
  17. AI SSD目标检测算法
  18. 添加mtdparts引起的问题
  19. Win10系列:UWP界面布局进阶7
  20. wpf 使用Font-Awesome图标字体

热门文章

  1. HTML初步入门
  2. Organize Your Train part II-POJ3007模拟
  3. C扩展python的module和Type
  4. 连接MySQL错误:Can't connect to MySQL server (10060)
  5. [issue] [iOS 10] 升级后无法真机测试 Could not find Developer Disk Image
  6. 系统hosts文件的作用
  7. TensorFlow支持windows了
  8. Codeforces 722C. Destroying Array
  9. android应用内存使用情况
  10. validate插件深入学习-04自定义验证方法