SQL*Plus is a handy command-line tool. If you’re using it as your main tool for running SQL, I would suggest using an IDE. I explain a few reasons why in this article.
It Saves Time
Using SQL*Plus is simple because it comes with all Oracle installations. However, I suggest using an IDE instead of SQL*Plus.
The main reason for this is that it saves time.
Using an IDE allows you to save files that you want to use more than once. You can open files you have previously saved. And you can often navigate between these files, as most IDEs support multiple tabs at once.
Most IDEs have a code autocomplete feature, which allows you to type the first few letters of an object or keyword, and have the IDE automatically complete it or suggest options. This is great for keywords but is also helpful for selecting columns with table aliases.
For example, if you have a table with an alias of “c”, you can often just enter “c.” and a list of columns will appear, making it a lot easier to write a query.
Many IDEs also include the concept of code snippets, which allow you to quickly add in commonly used pieces of code. You don’t need to manually type out all of the code that you want to use. Snippets can do that work for you.
These are just a few features of SQL IDEs that allow you to save time when compared to SQL*Plus. During a recent article, I wrote, that reviewed many different Oracle SQL IDEs, I found that most of them included many features to help save you time.
Download Oracle SQL Developer for free.
Easily Format Code
Another great feature of most SQL IDEs is that they allow you to format the code.
How many times have you seen SQL code that was a mess, and was hard to read?
It makes it harder to understand and maintain, and hard to find issues in the code.
With the formatting options available in SQL IDEs, you can apply formatting to your code so that it follows a common style and layout.
You can do this to your own queries that you write, to ensure your queries are easy to read. You can apply it to any new objects or code you write and compile on the database as well.
Work with Many Files at Once
I mentioned earlier that the ability to save and open files is a good feature of an IDE.
On top of that, IDEs let you work with many files at once. You can have many files or tabs open, and navigate between them very easily.
Different files allow you to run different queries and keep them intact if you need them later. You can have different tabs for different versions of a query, or different concepts you’re looking into.
In SQL*Plus, it’s a command line, so you’ll only be writing one query at a time. This can really slow you down and make it hard to use.
See Output in a Table
The last reason I have for using an IDE instead of SQL*Plus, and one of the most important, is that they allow you to see the results of your query in an easy-to-read table, rather than a messy text output.
Seeing an output in SQL*Plus is often a mess, as it’s text-based and doesn’t have the same formatting logic. To adjust columns, you need to write separate commands, and there is still a limit to how easily you can display the data.
Using the table output in many IDEs, you can see all of the data you need to, in well-formatted columns, which can be scrolled and sorted as needed.
It’s also easier to read in a table.
So, there are my reasons for using an IDE instead of SQL*Plus. Sure, there are some valid reasons for using SQL*Plus, but not many.
Hope you like the article. We highly appreciate comments and feedback.
Ben has over 10 years experience working in the software industry, and he enjoys teaching Oracle and database skills to other software developers.