SQL Developer import data from Excel to Oracle problem - remove the invisible space from Excel
Today I have to import last year 's sales data into database for sales analytics. the sales data is in excel format. I have to work out a way to import the excel data into Oracle database.
Fortunetly Oracle 's free tools SQL Developer provide an easy way for importing excel data. So I download and setup the Oracle SQL Developer in my laptop.
SQL Developer is very easy to use. I thought I could easily import the data into Oracle database, just right-click at the table and select the menu 'import data', It is wizard guided process that is easy to follow.
The strange problem
But It turn out to be not so easy. I breeze the data and set reasonable column width for database varchar2 columns and start import the data.
But I keep encounter the error:
ORA-12899 "value too large for column"
The error is easy to understand, The column might not be large ennough for the value and I extend the column width and import the data again.
But I run into ORA-12899 error again and again, the data in the excel is just a flag no more than six letter, Though I have use a varchar2 of 100, I still run into this error!
I notice some difference in the data import data preview page, there seems to be multiple 'small dot' after the column. I guess there must be invisible spaces after the value in the excel cell. and It turn out to be right!

How do I remove these abominable 'spaces'?
I know I could use Excel trim function to remove the space, but unfortunetly I 'm not familiar with VBA. I do some search and find out that there 're some Excel add-on that claim to be able to remove and trim space from cell.I download and run the plugin, but nothing happen!
What a stupid problem but It really give me a lot of trouble .Though I know where is the problem, but I could not get the space out.
At last , I gave up finding the answer using Excel. I just set each varchar2 columsn 's max length to 2000, and the data finally get imported into database.
I 'm not worried to dealing with these space problem in database table later, a simple SQL could remove them all!
Excel in some times is really weak , I re-discover the fact that database is much powerful than spreadsheet!
By the way , We should remove the Excel 'AutoFilter' at the column header before importing data using SQL Developer, SQL Developer is not able to recognize the column with 'AutoFilter' set!

TRIM function
You don't have to know any VBA to use the TRIM function. Just pick a blank column, =TRIM(ref to cell on same row). Then copy down the formula, and copy and paste values into where the original untrimmed data was from.