SELECT*from ALL_OBJECTS返回各种过程/ packages/tables /其他db对象的名称.我想在PL/SQL代码中查找匹配的字符串.我该怎么做呢?
类似于:(伪代码)SELECT*FROM all_code WHERE line_of_code like'%mytext%'
使用类似的东西:
SELECT * FROM USER_SOURCE WHERE type='PACKAGE' AND NAME='PACKAGE_NAME' ORDER BY type, name, line;
有很多选项,请查看USER_SOURCE表.
要搜索所有代码的字符串:
SELECT * FROM ALL_SOURCE WHERE UPPER(text) LIKE UPPER('%what I am searching for%') ORDER BY type, name, line
请注意,视图代码不包含在_SOURCE
表中.查看代码存储在[USER|ALL|DBA]_VIEWS.TEXT
LONG列中,难以查询.