Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL*Loader time format?
You COULD use date, I am sure. But what does your time mean? (I'm
assuming it's just a time, i.e. without a date, right?) Is it the time
today? Or just a time on any day?
If you use the date data type the value will have a date associated with it. If you don't specify it it seems to default to the 1st of the current month.
SQL> create table tmp (d date);
Table created.
SQL> insert into tmp values(to_date('9:30','HH24:MI'));
1 row created.
SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi'), 2 to_char(d,'yyyy-mm-dd hh24:mi') from tmp;
TO_CHAR(SYSDATE, TO_CHAR(D,'YYYY-
---------------- ----------------
Depending on what you want to do with the data, this might not be what you want. Other options would be to load the data into a/multiple number column(s) or a varchar.
For one number column you'd have to convert the minutes and seconds to
hours, e.g. 12:30:05 would become
12+30/60+5/3600.
the possibilities are endless, it all depends on what you want to do with the data once it's in the database.
Christian
News wrote:
>
> Hello everyone. I'm just learning Oracle and SQL*Loader and I'm in the
> middle on an import from dataease into Oracle 8i. I can't seem to find
> anything in the documentation about formatting time in my control file for
> SQL*Loader? Can I use DATE? If not, can I format time?
> Any suggestions are appreciated!
> Lesley
Received on Wed Feb 09 2000 - 10:14:43 CST