How to Remove “X Rows Selected” in SQLcl & SQL*Plus (Oracle)

When using SQLcl or SQL*Plus with Oracle Database, you may have noticed feedback at the bottom of your query results that tells you how many rows were selected. For example, 100 rows selected (or however many rows were returned).

If you want to get rid of this, you can use SET FEEDBACK OFF.

You also have the option of setting a row threshold, which allows you to specify how many rows should be returned before feedback is provided.

Continue reading

SET NULL: Specify a String to Return Whenever a Null Value Occurs in SQLcl / SQL*Plus

SQLcl and SQL*Plus are command line interfaces for working with Oracle Database.

By default, they return an empty string whenever null occurs as a result of a SQL SELECT statement.

However, you can use SET NULL to specify a different string to be returned. Here I specified that the string null should be returned.

Continue reading

How to Create a login.sql File for SQLcl

When using SQLcl (Oracle’s command line interface), you can create a login.sql file, and have it run each time you run SQLcl.

This allows you to have commands executed each time you run SQLcl. For example, you can specify your formatting preferences in the login.sql file, set up aliases, etc.

Here I show you how to create a login.sql file and how to make it run each time you run SQLcl.

Continue reading