SQLDeveloper jump between Package body and Package spec

亡梦爱人 提交于 2019-12-01 04:21:16

see the picture above-- the downward pointing side arrow -- click on it-- it will open up the function defintion. thanks

Go to VIEW menu, click on find DB objects option. In the find db object pane put the name of the package and select the DB.

Both, the spec and body will appear, double click to open.

You have a couple of questions:

  1. how to 'jump into' a pl/sql object AND
  2. how to toggle from spec to body and vice versa

How to 'jump into' a pl/sql object

Ctrl+Mouse Hover+Click

If you don't like this mouse-kung-fu, you can also assign a keyboard shortcut, I show you how to do this here.

How to toggle from spec to body and back

You can use the arrows in the gutter, they point up or down, you can use the toolbar button, or you can use the keyboard shortcut.

If you use the 'arrow' in the gutter, you'll go straight to that item's corresponding bit in the spec or body. Using the toolbar button/kb shortcut will just take you to line 1 of the spec or body.

I talk about these PL/SQL features and more on my blog.

(this is at least with my PLSQL-DEv version (11.0.4.1774), default settings)

The shortcut to view Spec. + Body is SHIFT+ F5, then CTRL+ H to toggle to the "body" tab.

This works if you have certain rights to view the package's body, especially the DEBUG right: ask your DBA to do you a

GRANT DEBUG on <package_you_want_to_view_the_body_of> to <your_user>

or

GRANT DEBUG on <package_you_want_to_view_the_body_of> to PUBLIC

Note sure but you might also need the EXECUTE right just to view. Same thing if needed, ask your DBA similar above grant.

nb:

Another thing I had to do in Oracle 12c for Code assistant to view the packages when typing: check the "Use DBA Views if available" in Tools > preferences:

After opening the package spec using Shift+F4, press Ctrl+Shift+F12 to open or toggle between body and spec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!