Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Number fields in Excel being considered NULL (empty)

  Asked By: Gene    Date: May 12    Category: Java    Views: 959
  

I need a solution for the following question urgently. I
hope any of you will give me the best solution.

I am using JDK 1.3.1 and the JDBC-ODBC bridge to retrieve data
from an Excel spreadsheet provided by a user. The spreadsheet
is created manually be the user, not by inserting data via JDBC.

A given column of data contains both numeric and alpha-numeric
data. When I encounter a row that has strictly numeric data,
the data is not returned in the query.

Example:

14A
B192
2349
16-9

Data is returned for 14A, B192, and 16-9, but 2349 returns a
null.

Note: If I CREATE the data in a spreadsheet via JDBC, I do not
have any problems retrieving numeric data. Only when the user
has entered the data does it pose a problem.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Waggoner Fischer     Answered On: May 12

I think one solution  for sovling this problem is casting your data  to String Format using SQL keywords like CStr, CAST and ...

The other solution is changing column  format in Excel file. (like text format or numeric)

I had the same problem when I was looking to import Excel tables to Palm Handhelds...

Just remember, that one column in Excel, can store different types of data format when they are inserted manualy ...

 
Didn't find what you were looking for? Find more on Number fields in Excel being considered NULL (empty) Or get search suggestion and latest updates.




Tagged: