Sql – Excel Date Field Import Problem in Oracle SQL Developer

exceloracleoracle-sqldevelopersqltimestamp

I have an Excel file (which has data imported from Oracle 10G Database) one of the fields is a
Date Filed which has values like 28-JAN-11 03.25.11.000000000 PM ( Date field is Oracle Time
Stamp(6) in Database )

When I am trying to Import that Excel file to another Oracle 10 G database (for another database/application), I get an error because the data field is not being recognized by Oracle 10G –> Import is being done by ORACLE SQL Developer (Table (field) has TIMESTAMP(6) as the datatype)

How can I import that field? For time being I made the TIMESTAMP to VARCHAR2 and its working but I could not convert that to Date field again in C# CODE ( it says not a valid date type).

Best Answer

You likely need to change your SQL Developer settings.

Tools->Preferences->Database->NLS

Modify the Timestamp Format field to conform to the data format in your Excel spreadsheet. Not how it appears in the first database, but what it looks like in your spreadsheet. For example, in my instance, the data in Excel was:

ID  DT
1   05/19/2011 10:16 PM

I changed the format in preferences to MM/DD/YYYY HH:MI AM

and was able to import successfully, after initially getting the same error you reported before changing preferences.

You may want to change the way your data is imported into Excel originally if you need more precision from your time values.