Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using sqlldr with millseconds

Status
Not open for further replies.
Jan 16, 2008
23
US
Hi,

I have some data in this format:
2011-01-31 00:00:00.000

I am getting "invalid date format" when I tried to load the file using: DATE "YYYY-MM-DD HH24:MI:SS.FF3"

How can I load it?'

Thanks
 
You need something like:

Code:
LOAD DATA
INFILE 'fred.dat'
REPLACE
INTO TABLE FRED
TRAILING NULLCOLS (
tscol position(1:25) char "TO_TIMESTAMP (:tscol, 'YYYY-MM-DD HH24:MI:SS.FF3')"
)

For Oracle-related work, contact me through Linked-In.
 
illectronic,

In addition to Dagon's excellent suggestion, have you considered using Oracle's External Tables? The feature allows you to access flat files as though they are full-fledged Oracle tables without your having to separately invoke Oracle*Loader. The other nice thing about External Tables is that if you replace the underlying flat file, but use the same file name, subsequent queries instantly show you the "new" data.

Let us know if this proves helpful to you.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
“People may forget what you say, but they will never forget how you made them feel.
 
I didn't have to use the ms at the end because all that data was 0, but thanks a lot! I can use this in the future.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top