You mentioned querying the session NLS parameters, but the value you showed appears to be NLS_TIME_FORMAT
, which is only used internally.
Oracle doesn't have a time-only type, so your field is presumably actually a DATE
type (or possibly TIMESTAMP
). The values in the column will have a date part, even if you ignore it.
SQL*Loader will use NLS_DATE_FORMAT
to interpret the data file value for a DATE
field. If that is DD/MM/YYYY
then it would liberally interpret a value like 22:41:17
as the 22nd day of the 41st month - hence your error - in the year 17.
You can specify the date format model in the control file:
TIME DATE 'HH24:MI:SS',
The value in the table would have that time, on the first day of the current month.
The SQL*Loader documentation does refer to a TIME
data type which I have never seen used, and I can't find any references to it anywhere, including MOS. A quick bit of experimentation hasn't helped. If I make the control file entry:
TIME TIME,
... then the record is rejected with ORA-00933: SQL command not properly ended
. The log file also shows the data type as DATETIME HH24.MI.SSXFF
, which looks related to the NLS_TIME_FORMAT
value. I haven't found a way to make it accept that. If I change the column definition from DATE
to TIMESTAMP
then I get a different error, ORA-00904: "TO_TIME": invalid identifier
, which is even stranger. It almost looks like these data types are defined in SQL*Loader for future use. (This discussion suggests they thought about adding TIME
as a database type in 10g, but obviously can't verify that. And this is in the SQL*Loader reference at least back to 9i).