I have some code…

BEGIN
 give_raises();
END;
/

I can guess that GIVE_RAISES is a procedure of some kind. But now I want to open it, or ‘go to it’ or ‘step into it.’

And I want to do so without having to pick up my mouse.

So I could tell you about the Ctrl+Click trick, but that’s all mouse.

So what’s a child of the 80’s to do?

Define a keyboard shortcut for ‘Open Declaration’ and then use that.

Ctrl+Mouse Click versus using the keyboard to open my procedure.

It’s not JUST for PL/SQL

Yup, it works for TABLES too!

Note that I have two Document Tab Groups going, that’s why you can see my SQL Worksheet and the EMPLOYEES table side-by-side.

Keyboard Shortcuts

We don’t have enough keys to assign EVERYTHING a keyboard shortcut. Open Declaration was one of them. So, decide what makes sense for you. For me, it was ALT+I (I = Inspect.)

Everything You Need to Know about Keyboard Shortcuts PLUS A Cheat Sheet!

Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

15 Comments

  1. Slavko Brkic Reply

    Hmmm,

    Odd I got it working now. Thanks for your time.

    When doing the jump I get to the package spec and then need to click the arrow (to the left of the proc/func name) to get to the body for that procedure/function. Is there a setting to default it to go to the package body automatically ?

  2. Slavko Brkic Reply

    Hi Jeff and thanks for your answer,

    So from the anon block it works fine to navigate to the package and the specified procedure. All good.

    Now I am in that procedure seeing what it does. I see that it calls another procedure lets say in package x, procedure y. Now I want to navigate directly to the x.y procedure. However I am not able to do that.
    I do know that it is possible to Shift-F4 to the spec and then Alt-Shift-F12 to the body and then use the code navigator to jump to the specified procedure. But we would like to be able to do the direct navigation if that is possible.

    And again the reason I am asking is that this kind of drill down is extensively used for investigations/debugging and we are currently doing some investigations to replace our current third party tool with Sql Developer.

    • So I can go multiple levels and you cannot.

      So we can test similar path, on the last level, can you try a call to dbms_output.put_line() from your plsql program?

      That works for me here.

  3. Slavko Brkic Reply

    If i write a call to a package within a pl/sql block like this:

    BEGIN
    customer_data.get_customer(id=>i/*varchar2*/,name=>n/*varchar2*/,regno=>r/*varchar2*/,language=>l/*varchar2*/
    );
    END;
    /

    I am able to navigate to the specified procedure/function within the package.

    But if I have navigated to that package and this procedure/function calls another package I am not able to drill down and navigate to this directly.

    Am I doing something wrong or is this the way the functionality works.

    If it is the way the functionality works currently are there any plans to expand the functionality to enable this?

    Reason I am asking is that this kind of drill down is extensively used for investigations/debugging and we are currently doing some investigations to replace our current third party tool with Sql Developer.

    BR,
    Slavko

    • I have an anon block, that calls a procedure.

      I can ctrl+click to navigate to that procedure.

      That procedure calls a package.

      I can ctrl+click to package.procedure that I’m calling.

      So what you’re describing, should be working just fine.

  4. Excellent . This is something many functional folks asked me about.

  5. Daniel Castillo Reply

    How can I do this but with functions and stored procedures defined inside a package?

    • The exact same way.

      So if I have

       
      BEGIN
       customer_data.get_customer(id=>i/*varchar2*/,name=>n/*varchar2*/,regno=>r/*varchar2*/,language=>l/*varchar2*/
       );
       END;
       /

      And i put my cursor on the get_customer text, when it opens the Package, the focus will be on the declaration for the get_customer procedure.

    • Daniel Castillo

      Thank you very much.

      When I Ctrl+Click a function defined inside the same package it works perfectly but when I Ctrl+Click a function that is defined in another package, the focus ends in the package header and not in the package body.

    • Yes, it’s supposed to go to the spec. Once you’re in the spec you can easily toggle to the body though.

    • Daniel Castillo

      Excellent! and again thank you very much.

  6. Geraldo Viana Reply

    Hi. Thanks for the great SQL Developer Tool. The F5 shortcut(run script) in worksheet is OK and handy. But almost in every session I hit the F5 in the script output pane and the worksheet is emptied. Can your team fix these please.

    • The script output is emptied or the editor itself is cleared?

      Neither should be happening, and I don’t see that happening. What version do you have? Can you post the exact series of steps you are doing to see that behavior?

Write A Comment