How-To: Find Empty Columns in an Oracle Database

In this How-to I will show you how to find Empty Columns in an Oracle Database. I came across a situation where I found a whole bunch of records some of which were inconsistent. I needed to find a way to print the records with the blank columns. This way I could then give the list to the proper people so they could fix the records….Sometimes I really do feel like a janitor, always Cleaning up someone else’s mess.

Once you get connected to your database using SQLPlus, its really easy, just run this query:

Query: Find Empty Columns in an Oracle Database

SELECT *
FROM TABLE
WHERE TRIM(cloumnName) IS NULL;

This should spit out all the records with blank entries in the column name you requested in the query. If you use Oracle’s SQLDeveloper tool you can export the data in a nice CSV. You would use the same query if your using SQLPlus or SQL Developer. You can then take the CSV and import it into Excel, and formate it to your hearts content.

Thats all there is to finding empty columns in an Oracle database.


Posted

in

, ,

by

Tags:

Comments

Leave a Reply

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