PL/SQL Developer:如何查找变量引用?
在Oracle包中,如何找到变量的所有引用?就像您在 Eclipse 或 Visual Studio 中所做的那样。
TOAD、Sql Developer 或 PL/SQL Developer 等 Oracle IDE 是否支持此功能?我正在使用 PL/Sql 开发人员?
In a Oracle package, How can I find out all the references for a variable? Like you would do it in Eclipse or Visual Studio.
Is this feature supported in any Oracle IDEs like TOAD, Sql Developer or PL/SQL Developer? I am using PL/Sql developer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 PL/SQL Developer 中,我使用“查找数据库对象”工具(“工具”菜单,“查找数据库对象”,或点击浏览器上的双筒望远镜按钮)。在“要查找的文本”框中输入您要查找的文本(例如变量的名称),在“所有者”框中输入您感兴趣的对象的架构名称,然后输入您感兴趣的包名称在“名称”框中。选择要搜索的对象类型(函数、过程等),然后单击“搜索”按钮。
如果您对变量的完全限定使用感兴趣,您只需输入 SCHEMA_NAME.PACKAGE_NAME.VAR_NAME 之类的内容 - 或者尝试使用 PACKAGE_NAME.VAR_NAME 进行部分限定使用。
分享并享受。
In PL/SQL Developer I'd use the "Find Database Objects" tool (Tools menu, "Find Database Objects", or hit the binoculars button on the browser). Enter the text you want to find (e.g. the name of your variable) in the "Text to find" box, enter the schema name of the object you're interested in in the Owner box, and enter the package name you're interested in in the "Name" box. Select the objects types you want to search (Functions, Procedures, etc) and then click the Search button.
If you're interested in fully-qualified uses of a variable you can just enter something like SCHEMA_NAME.PACKAGE_NAME.VAR_NAME - or try PACKAGE_NAME.VAR_NAME for partially-qualified uses.
Share and enjoy.
有两种方法,您可以找到
1) 点击双筒望远镜按钮
2) 使用查询(适用于 Oracle)
选择* 来自 ALL_SOURCE,其中文本如“%some string%”;
Two ways, you can find
1) hit the binoculars button
2) Using Query(Works for Oracle)
select * from ALL_SOURCE where text like '%some string%';
有 PL/Scope,但说实话,它是有点像野兽,我自己从来没有尝试过。
当然,您可以在当前包中进行搜索并查看所有突出显示的匹配项,但这并不理想,因为文本搜索不考虑范围,并且可能存在多个同名变量。
PL/SQL Developer 的 Refactor 选项可以解析变量范围,所以我不明白为什么它不能至少突出显示当前包中的所有引用。也许您可以在 Allround Automations PL/ 上提出建议SQL Developer 论坛 并获取 marco 著名的“我已将其添加到增强请求列表中”的答案之一。 (一定要每隔 5 年左右发布一篇后续帖子来提醒他这一点。)
There is PL/Scope, but to be honest it's a bit of a beast and I've never tried it myself.
Of course you can search within the current package and see all occurrences highlighted, but that isn't ideal as a text search doesn't take scope into account and there could be more than one variable with the same name.
PL/SQL Developer's Refactor option can parse variable scope, so I don't see why it couldn't highlight all references in the current package at least. maybe you could propose it on the Allround Automations PL/SQL Developer forum and get one of marco's famous 'I have added this to the list of enhancement requests' answers. (Be sure to remind him about it with a follow-up post every 5 years or so.)