Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*LOADER: converting ulong date-time to oracle format
Here is a SQL*Loader CTL file i use to load C++ time_t fields into
Oracle :
<cut><cut>
load data characterset us7ascii
infile "whatever.dat" "fix 26"
append
into table dulf_data
(
car_number smallint ,
location_id char(7),
event_level_rev position(10) byteint "ROUND(:EVENT_LEVEL_REV/16)",
event_level_code position(10) byteint "MOD(:EVENT_LEVEL_REV,16)",
diagnostic_code smallint,
first_set integer
"to_date('1970-01-01','YYYY-MM-DD')+(:FIRST_SET/60/60/24)",
last_set integer
"to_date('1970-01-01','YYYY-MM-DD')+(:LAST_SET/60/60/24)",
last_reset integer
"decode(:LAST_RESET,0,null,to_date('1970-01-01','YYYY-MM-DD')+(:LAST_RESET/60/60/24))",
counter smallint
)
<end cut><end cut>
time_t fields are expressed in a long as seconds since January 1st,1970.
Is this any help ?
Regards,
Marc Mazerolle
InforMaze Technologies
Furkan Khan wrote:
> select encode(*) from sys
> 21,'Responder',26593,924751530,924755728,1,0,119,4,15,0,0,0,0
>
> In the above example, column 4 and 5 are the date/time stamps.
> They are standard Universal date time, when decoded with
> our proprietary function they look like:
>
> select date(sys_updated) from sys
> Wed, 21 Apr 1999 21:35:28 PDT
>
> Unfortunately, I can't use this date function, I need to directly
> translate from ulong to ORACLE date.
>
> Any help appreciated.
>
> Regards.
> fk
Received on Mon May 10 1999 - 13:41:48 CDT
![]() |
![]() |