You may wish to store your PL/SQL code in files with file extensions other than our defaults.

We ship with .klr, .pkb, .pkh, .pks, .plb, .pls as associated file types for our PL/SQL editor and for opening said files on your machine with SQL Developer.

But maybe at XYZ Incorporated, you keep your package bodies in files of type .bdy

Are you stuck using our SQL Worksheet for doing serious PL/SQL work?

No!

Just setup your preferences.

Defining YOUR PL/SQL File Types

Open the prefernces, go to File Types, and add a new one. Set your extension, and be sure to use the drop down control below to set the FIle Type to ‘PL/SQL.

This tells SQL Dev to put your file into a PL/SQL editor with all the fancy PL/SQL IDE features available.

Repeat as necessary.
Repeat as necessary.

Now let’s open a file.

I prefer to compile straight into PROD, #EvilLaugh
I prefer to compile straight into PROD, #EvilLaugh
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.

12 Comments

  1. Kevan Gelling Reply

    It is possible to change the pre-set file types associations? For example, I’d like my ‘*.pkb’ files to open in a “SQL Script” window (so I can use Run Script – F5) instead of the default – “PL/SQL”.

    • I don’t believe so, but you can do what you want, basically.

      Just use @my_scripts.pkb and run with F5 in your worksheet

    • Kevan Gelling

      Or rename all my packages to have a ‘.sql’ suffix 🙂

    • if they’re actually sql*plus scripts, then I WOULD do that

      if they’re solitary standalone stored procs saved in a file – then I would use the procedure editor and not the worksheet to compile your pl/sql

    • Kevan Gelling

      They are both – a standalone package spec or body surrounded by SQL*Plus directives (and a couple of house-keeping procedures).

  2. Is there anyway to associate the extension we want when we use Quick DDL – save to file or export? I want to export the stored procedure to have the .prc, and functions to have .fnc, triggers to have .trg extensions. But it seems like the only option is .sql or .pls. I know we could change them manually, just wondering if I’m missing a setting somewhere.

  3. Troy Tuttle Reply

    I just updated SQL Developer from 4.0 to 4.1. In 4.0 I set the file extension for .pb files to be SQL Script, which worked fine. However, after upgrading 4.1 treats .pb files as PL/SQL file types regardless of the setting in preferences. Any idea how to resolve this?

  4. David Grimberg Reply

    I typically add .PLS extention (for specs) to complement the .PLB extention (for bodies) that already exists in SQL Developer.

  5. Hi Jeff,

    Is it possible to use the SQL Developer PL/SQL editor for editing packages in the fysical model in Data Modeler? Now it opens in a other editor without all the fancy features.

    • Developing stored procedures should be done in SQL Developer. We’ve debated removing the code editor completely from the modeler for stored procs. We’re definitely not going to put the entire ‘live’ procedure editor in the modeler – then folks will want a debugger, yada, yada, yada.

  6. I use this feature for some time (the same .bdy extension), but I think there is a bug. I opened one of files with .bdy before binding it to PL/SQL file types and now it always opens as normal SQL file instead of PL/SQL. That is I have standard icon and standard menus. All other .bdy files are opening as PL/SQL.

Write A Comment