Oracle通过一个Value值查询数据库
2024-09-22 02:12:57
---恢复内容开始---
大家在想看看数据库中有哪些数据表中,哪些字段中有“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。
最新文章
- OOM killer
- Converter转换器使用
- R12将银行和分行都使用TCA管理
- tomcat下运行多个项目
- sqlserver2008 R2 创建作业(定时任务)
- Project中分清楚挣值项
- lintcode:交错正负数
- JS单元测试框架:QUnit
- compser 执行命令提示do not run composer as root/super !
- AOP概念
- 11427 - Expect the Expected(概率期望)
- hibernate 多对多 最佳实践
- Broken Keyboard(悲剧文本)
- 老李分享:Python开发性能测试脚本
- numpy 数组索引数组
- Mybatis框架可视化(1)
- AI SSD目标检测算法
- 添加mtdparts引起的问题
- Win10系列:UWP界面布局进阶7
- wpf 使用Font-Awesome图标字体
热门文章
- HTML初步入门
- Organize Your Train part II-POJ3007模拟
- C扩展python的module和Type
- 连接MySQL错误:Can't connect to MySQL server (10060)
- [issue] [iOS 10] 升级后无法真机测试 Could not find Developer Disk Image
- 系统hosts文件的作用
- TensorFlow支持windows了
- Codeforces 722C. Destroying Array
- android应用内存使用情况
- validate插件深入学习-04自定义验证方法