niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle
Problem with SQLLoader Date columns and JDBC access
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Thomas Kellerer
*nix forums addict


Joined: 15 Apr 2005
Posts: 82

PostPosted: Thu Jul 20, 2006 9:23 am    Post subject: Re: Problem with SQLLoader Date columns and JDBC access Reply with quote

On 19.07.2006 15:36 Mark D Powell wrote:
Quote:
If the table column is defined as a date but the character represtation
of the date is a timestamp truncate off the fractional seconds using a
substr function. From my notes where I did something like this:

FLD2 NEXT * , O(") CHARACTER
SQL string for column :
"to_date(substr(:fld2,1,19),'YYYY.MM.DD.HH24.MI.SS')

Worked for me.

For me too Wink
I never tried to use to_date() I always declared the column as DATE and
then tried the substr() thing. Bu this works fine.

Thanks a lot!

Thomas

--
It's not a RootKit - it's a Sony
Back to top
Mark D Powell
*nix forums Guru


Joined: 23 Apr 2005
Posts: 701

PostPosted: Wed Jul 19, 2006 1:36 pm    Post subject: Re: Problem with SQLLoader Date columns and JDBC access Reply with quote

Thomas Kellerer wrote:
Quote:
Hello,

here is the setup: I'm importing a text file using SQLLoader into an
Oracle 9i database. As the file contains date values with fractional
seconds I am forced to use the following definition in the control file:

daterecorded TIMESTAMP "YYYY-MM-DD HH24:MM:SS.FF"

note that the column in the database is defined as DATE not as TIMESTAMP.

now when I import this into my table, SQL*Loader completes successfully.

But when I try to access this column via JDBC using getTimestamp() the
driver throws an IllegalArgumentException (in
oracle.jdbc.driver.DateTimeCommonAccessor.zoneOffset())

When I use direct=false for SQL*Loader JDBC access works fine.

I tried the JDBC driver for Oracle9, 10gR1 and 10gR2, no difference.

Does anyone have an idea how I could keep using direct=true but convince
SQL*Loader to write the date column correctly? Maybe a better definition
in the control file? (I have tried several ways with trim() and substr()
but to no avail, the above definition is the only one I could get to work)

To be honest this is more out of personal curiosity then a real project
need, as I could live with direct=false without problems.

Cheers
Thomas


--
It's not a RootKit - it's a Sony


If the table column is defined as a date but the character represtation
of the date is a timestamp truncate off the fractional seconds using a
substr function. From my notes where I did something like this:

FLD2 NEXT * , O(") CHARACTER
SQL string for column :
"to_date(substr(:fld2,1,19),'YYYY.MM.DD.HH24.MI.SS')

Worked for me.

HTH -- Mark D Powell --
Back to top
Thomas Kellerer
*nix forums addict


Joined: 15 Apr 2005
Posts: 82

PostPosted: Wed Jul 19, 2006 7:33 am    Post subject: Problem with SQLLoader Date columns and JDBC access Reply with quote

Hello,

here is the setup: I'm importing a text file using SQLLoader into an
Oracle 9i database. As the file contains date values with fractional
seconds I am forced to use the following definition in the control file:

daterecorded TIMESTAMP "YYYY-MM-DD HH24:MM:SS.FF"

note that the column in the database is defined as DATE not as TIMESTAMP.

now when I import this into my table, SQL*Loader completes successfully.

But when I try to access this column via JDBC using getTimestamp() the
driver throws an IllegalArgumentException (in
oracle.jdbc.driver.DateTimeCommonAccessor.zoneOffset())

When I use direct=false for SQL*Loader JDBC access works fine.

I tried the JDBC driver for Oracle9, 10gR1 and 10gR2, no difference.

Does anyone have an idea how I could keep using direct=true but convince
SQL*Loader to write the date column correctly? Maybe a better definition
in the control file? (I have tried several ways with trim() and substr()
but to no avail, the above definition is the only one I could get to work)

To be honest this is more out of personal curiosity then a real project
need, as I could live with direct=false without problems.

Cheers
Thomas


--
It's not a RootKit - it's a Sony
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 10:28 pm | All times are GMT
navigation Forum index » Databases » Oracle
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts [554] Relay access denied annami Postfix 0 Tue Oct 21, 2008 9:12 am
No new posts [554] Relay access denied annami Postfix 0 Tue Oct 21, 2008 9:11 am
No new posts [554] Relay access denied annami Postfix 0 Tue Oct 21, 2008 9:10 am
No new posts Unknown in header problem -SOLVED- Light Speed Postfix 0 Thu Jul 03, 2008 10:40 am
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am

Hotels in Calais | Mortgage Calculator | Mortgage Calculator | Budapest | Mobile Phone
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3663s ][ Queries: 20 (0.2749s) ][ GZIP on - Debug on ]