I used to think that for effective PL/SQL development, the only options were tools like TOAD, Allround Automation's PL/SQL Developer or Oracle's own SQL Developer. All heavyweight IDEs with tons of database features, but pretty dated compared to other modern IDEs.

plsql dev Allround Automations PLSQL Developer IDE


Most of the time, when I'm writing code, I want a clean and unfussy interface, speed and great text editing features. I've been using Sublime Text 3 for the last year or so now, mostly for PHP development, but with a couple of tweaks it makes for an excellent PL/SQL development tool as well.

sublime Sublime 3 : Using the Cyanide theme with Monokai colour scheme


Firstly, although Sublime supports syntax highlighting for many languages out of the box, PL/SQL isn't one of them. For that, I am using a 3rd party package called Oracle PL/SQL available via package control in Sublime. Details here.

Now, to execute the current PL/SQL file or SQL script I created a build system for SQLPlus containing schema details and the location of a compilation file. $file is used to pass the currently selected filename as a parameter to compile.sql.

{
    "cmd": [
        "sqlplus",
        "scott/tiger@demo",
        "@\\\\\\home\\compile.sql", "$file"
    ]
}

The associated compile.sql file is a two-liner that executes the specified script and issues a show errors afterwards so that I can debug.

@"&1";
show errors;

That's it! This is now what I use most of the time when working on PL/SQL. I use a fully fledged Oracle IDE intermittently to view my schema objects and perform ad-hoc DML operations, but am much more comfortable writing code and applying objects in Sublime, especially since I like to swap between JavaScript and PL/SQL fairly often.