give me some actual, working code...but i got a stub working where ctrl-click will take me to the procedure declaration, say if you called proc123 from proc456 in the body.
For the cursor/other nav, you might want to look at the Code Outline (avail on a right-click in the code editor)
Thanks. So with a piece of stubbed/dummy code the procedure level navigation works. Example code below at the bottom of this post. If I open that package in SqlDev I can ctrl-click on child_process in the "child_process(rec.object_name);" line and it and it does take me to the procedure. So it's working on simple level packages.
However, if I'm in a real-life more complex package that often doesn't work. Just one example from our EBS 12.2 installation is package IBY_FNDCPT_EXTRACT_GEN_PVT. I won't attach the code but I assume you could get access to it. We're on version 120.48.12020000.23. Example in this screenshot show line "Insert_Into_Gt(p_mbatchid);". If I ctrl-click there I get error that it does not exist. But you can see from the screenshot that procedure is defined both as forward-declaration and later in package. But ctrl-click navigation not working.
So the Code Outline does help some but have to hunt through it to find procedure etc.. Other tools such as Toad or Pl/Sql Developer handle this navigation fine.
Also from Code Outline perspective, if I want to navigate to sub-procedure details - such as cursor definitions within a given subprocedure - those don't even show up. In my example code, if I wanted to navigate to the cur_random_data cursor definition by ctrl-clicking on "FOR rec IN cur_random_data" that does not work. It highlight the word cur_random_data but does not jump to it. And if I look at the Code Outline in either the simple or the detailed setting (shown below) the cursor definition does not show up there either. So Code Outline doesn't help. Am I missing some sort of config or setting for that?
Example Test Package
CREATE OR REPLACE PACKAGE jm_sqldev_test AS
PROCEDURE child_process (pv_object VARCHAR2);
create or replace PACKAGE BODY jm_sqldev_test AS
-- Child Process
PROCEDURE child_process (pv_object VARCHAR2) IS
-- Main Process
PROCEDURE main_process IS
CURSOR cur_random_data IS
WHERE rownum <= 10;
FOR rec IN cur_random_data
1 person found this helpful
Full parse tree for large package bodies can be overwhelming. This is why some branches are hidden or collapsed. Also the goal was to make the simple and the detailed outlines to look similar in appearance. Here is how to expand the procedure declaration and body and, consequently, witness the cursor:
Unfortunately, even after expanding the tree, I'm unable to search for the "cur_random_data" which seems like a bug. The second bug is that ctrl-click on "cur_random_data" usage should jump to the definition.
I admit that the idea of intelligent parse tree expansion needs to be reevaluated.
Thanks Vadim Tropasko. I didn't realize the expansion that the hide/filter button let me do on the parse tree. My oversight. That does help to some extent so score one for Sql Developer on flexibility/configurability there. Although I would note that the amount of detail you end up with on the resulting parse tree is very difficult to work with (in my opinion) in comparison to the default trees that show in other tools (Toad and Pl/Sql Developer). I'll have to play with the options to see if I can get it down to a manageable parse tree when dealing in packages with thousands of lines.
So what I'm seeing here are 3 possible bugs...
1) Can't consistently Ctrl-click within a package body to jump to other sub procedures/functions (as noted in the IBY_FNDCPT_EXTRACT_GEN_PVT example). This makes the Code Outline much more important since can't "easily" jump to right location.
2) Can't use the Ctrl-Click navigation to jump to items such as cursors that are defined in a sub-procedure.
3) Can't search for some things when expanding the parsing tree as you noted
This discussion at least slightly alleviates some of the nuisance when dealing with large packages. I'll have to play around with the parse tree to see what I can make work best of mr.
we don't have access to the ebs packages, at least no easily , but Vadim may be able to manage per his point 1/bug