I'm trying to create an automated process that will upload a file to a Oracle database daily.
I'm having issues with date formatting. In the CSV file which I need to upload, a date is formatted as "mm:ss.0". However when selecting that cell the formula bar shows the full date as a timestamp, eg "dd/mm/yyyy hh24:mi:ss". The column I'm trying to upload this into is TIMESTAMP(6).
I'm not sure what format to put in SQL*Loader. Currently this is my control file, which errors:
OPTIONS (SKIP=1)
LOAD DATA
INFILE 'C:\Users\test.csv'
INSERT INTO TABLE test
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
(
id integer,
created_at timestamp 'DD/MM/YYYY HH24:MI:SS',
)
Possibly wrongly, I'm currently working on the assumption that if I can find out what to put into the "Data Type" box in the manual Oracle SQL upload window this will also work for SQL*Loader. So far I've tried:
DD/MM/YYYY HH24:MI:SS
- error: CREATED_AT GDK-05043: not a valid monthDD/MM/YYYY HH24:MI:SS.FF
- error: CREATED_AT GDK-05043: not a valid monthMI:SS.0
- error: CREATED_AT GDK-05021: date format not recognizedMI:SS.FF
- error: CREATED_AT GDK-05030: The date format pattern ends before converting entire input string.HH24:MI:SS.FF
error: CREATED_AT GDK-05030: The date format pattern ends before converting entire input string.
The file is getting sent to me via email, so I'm unable to change the format in Excel (while that works if I open the file and do it manually for one upload, the point is I want this to happen with no imput from me!)
It would be great if you'd be able to point me in the right direction.