I'm trying to import an excel file into a table. The excel file has dates in the following format: 20/08/2008 12:00:00 AM
and I am telling SQLDEV the following: DD/MM/YYYY H24:MI:SS AM
To import the file, I am right clicking on the table in SQL Developer, hitting import data and then selecting the file, I map the columns and set the format to above and get the above error. Here's the table:
--------------------------------------------------------
-- DDL for Table DRUG_INFO_NOS
--------------------------------------------------------
CREATE TABLE "DANIEL"."DRUG_INFO_NOS"
( "DIN" VARCHAR2(20 BYTE),
"TRADE_NAME" VARCHAR2(50 BYTE),
"FORM" VARCHAR2(40 BYTE),
"GENERIC_NAME" VARCHAR2(60 BYTE),
"MANUFACTURER" VARCHAR2(100 BYTE),
"CR_DATE" DATE,
"NOC_DATE" DATE,
"FIRST_CLAIM_DATE" DATE,
"SEQUENTIAL_ID" NUMBER
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "DATAL03" ;
--------------------------------------------------------
-- Constraints for Table DRUG_INFO_NOS
--------------------------------------------------------
ALTER TABLE "DANIEL"."DRUG_INFO_NOS" MODIFY ("DIN" NOT NULL ENABLE);
ALTER TABLE "DANIEL"."DRUG_INFO_NOS" MODIFY ("TRADE_NAME" NOT NULL ENABLE);
ALTER TABLE "DANIEL"."DRUG_INFO_NOS" MODIFY ("GENERIC_NAME" NOT NULL ENABLE);
ALTER TABLE "DANIEL"."DRUG_INFO_NOS" MODIFY ("MANUFACTURER" NOT NULL ENABLE);
ALTER TABLE "DANIEL"."DRUG_INFO_NOS" MODIFY ("SEQUENTIAL_ID" NOT NULL ENABLE);
but I am getting the above error. What's up?
-
You have not provided enough information. Post the error message, structure and data-types of existing table in db. and what steps you are using to import excel file. How many spaces are in that excel date you provided? Looks like there are 2 spaces between date and time. Not sure if this could be an issue...Angelina– Angelina2015年06月09日 17:28:45 +00:00Commented Jun 9, 2015 at 17:28
-
I fixed the 2 spaces problem, but I'm still getting the same error. I will update the question shortly.Daniel Paczuski Bak– Daniel Paczuski Bak2015年06月09日 17:32:44 +00:00Commented Jun 9, 2015 at 17:32
-
You should use the "insert script" option in order to actually see what SQL Dev is doing, and fix it on the way. I did a test and I saw that date formats from excel files doesn't import hour data in SQL Dev. May be a bug. Your best option is to save the excel file into a CSV, and import it from there.vegatripy– vegatripy2015年06月10日 15:14:43 +00:00Commented Jun 10, 2015 at 15:14
-
1What "above error?" There is no error message in your question.Air– Air2016年01月27日 22:49:28 +00:00Commented Jan 27, 2016 at 22:49
-
I probably edited it and accidentally removed that. Would've been a better question to ask 7 months ago :PDaniel Paczuski Bak– Daniel Paczuski Bak2016年01月28日 17:32:52 +00:00Commented Jan 28, 2016 at 17:32
1 Answer 1
This link shows how to deal with importing excel file and invalid date format: how-to-import-excel-to-oracle. Hope this helps.
-
Would be good to have a little explanation here, instead of just the Link. It will be helpfull.Racer SQL– Racer SQL2015年06月09日 17:43:32 +00:00Commented Jun 9, 2015 at 17:43
-
I already looked at that page before posting here, it didn't help.Daniel Paczuski Bak– Daniel Paczuski Bak2015年06月09日 17:48:05 +00:00Commented Jun 9, 2015 at 17:48