Customizing File Extensions for Your PL/SQL Code

thatjeffsmith SQL Developer 12 Comments

Tell Others About This Story:

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

Tell Others About This Story:

Comments 12

  1. 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”.

    1. thatjeffsmith Post
      Author
        1. thatjeffsmith Post
          Author

          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

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

          2. thatjeffsmith Post
            Author
  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. 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. 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.

    1. thatjeffsmith Post
      Author

      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.

Leave a Reply

Your email address will not be published. Required fields are marked *