How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC) [message #270705] |
Thu, 27 September 2007 16:25 |
rk1_23
Messages: 17 Registered: September 2007 Location: us
|
Junior Member |
|
|
Hi
Can anyone help me
i have a oracle database where my ad_date caolumn is date datatype
and my acess DB has ad_date as text database
so without changing there design i want to load my data to oracle
i used sqlldr for that but it showin me error
CAN ANYONE TELL ME HOW TO CONVERT TEXT datatype from CSV file to Date Datatype while loading data in control file into oracle
OAD DATA
INFILE 'errors.csv'
INSERT INTO TABLE errors
FIELDS TERMINATED BY ',' optionally enclosed by '"'
TRAILING NULLCOLS
(
ID,
mno INTEGER EXTERNAL,
usid,
add_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
add_user,
rev_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
rev_user)
so my text file i.e errors.csv or acess data have date as text datatype but i created a date datatype in oracle
if both have same datatype its moving just fine but with diff datatypes its not. my date string looks like
"Fri, 26 Mar 2004 19:07:56 UTC"
Please can anyone tell regarding this ASAP
Thanks in advance
your help is appreciated
|
|
|
Re: Loading data from Excel to the oracle database [message #270707 is a reply to message #270705] |
Thu, 27 September 2007 16:34 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
rk1_23,
Why did you hijack this thread and ask a totally different question?
>if both have same datatype its moving just fine
So make sure both have same datatype
>i used sqlldr for that but it showin me error
Error? What error? I don't see any error.
>but with diff datatypes its not.
My car is not working. Tell me how to fix it.
> my date string looks like "Fri, 26 Mar 2004 19:07:56 UTC"
Is this the one that works or the one that fails?
>Please can anyone tell regarding this ASAP
Explain why it is urgent for ME to solve this problem for you.
[Updated on: Thu, 27 September 2007 16:42] by Moderator Report message to a moderator
|
|
|
|
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF) [message #270948 is a reply to message #270798] |
Fri, 28 September 2007 09:55 |
rk1_23
Messages: 17 Registered: September 2007 Location: us
|
Junior Member |
|
|
LOAD DATA
INFILE 'errors.csv'
INSERT INTO TABLE errors
FIELDS TERMINATED BY ',' optionally enclosed by '"'
TRAILING NULLCOLS
(
ID,
mno INTEGER EXTERNAL,
usid,
ad_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
ad_user,
re_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
re_user)
i want to load the above columns to oracle database
but my .csv or access database has ad_date as text field but i created ad_date as date datatype in oracle
so i want to convert that while loadin it to oracle
i.e from text to date datatype
my date format is in this 'DY,DD MON YYYY,hh24:mi:ss TZD' in csv file
im using sqlloader. Please can anyone help me regarding this
Thanks
|
|
|
sqlloader problem in coverting datatypes [message #270950 is a reply to message #270705] |
Fri, 28 September 2007 09:59 |
rk1_23
Messages: 17 Registered: September 2007 Location: us
|
Junior Member |
|
|
LOAD DATA
INFILE 'errors.csv'
INSERT INTO TABLE errors
FIELDS TERMINATED BY ',' optionally enclosed by '"'
TRAILING NULLCOLS
(
ID,
mno INTEGER EXTERNAL,
usid,
ad_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
ad_user,
rv_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
rv_user)
i want to load the above columns to oracle database
but my .csv or access database has ad_date as text field but i created ad_date as DATE datatype in oracle
so i want to convert that while loadin it to oracle
i.e from text to date datatype
my date format is in this 'DY,DD MON YYYY,hh24:mi:ss TZD' in csv file
im using sqlloader. Please can anyone help me regarding this
Thanks
|
|
|
|
|
Re: sqlloader problem in coverting datatypes [message #270953 is a reply to message #270950] |
Fri, 28 September 2007 10:02 |
rk1_23
Messages: 17 Registered: September 2007 Location: us
|
Junior Member |
|
|
Hi
Can anyone help me
i have a oracle database where my ad_date caolumn is date datatype
and my acess DB has ad_date as text database
so without changing there design i want to load my data to oracle
i used sqlldr for that but it showin me error
CAN ANYONE TELL ME HOW TO CONVERT TEXT datatype from CSV file to Date Datatype while loading data in control file into oracle
LOAD DATA
INFILE 'errors.csv'
INSERT INTO TABLE errors
FIELDS TERMINATED BY ',' optionally enclosed by '"'
TRAILING NULLCOLS
(
ID,
mno INTEGER EXTERNAL,
usid,
ad_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
ad_user,
rv_date to_Date('DY,DD MON YYYY,hh24:mi:ss TZD'),
rev_user)
so my text file i.e errors.csv or acess data have date as text datatype but i created a date datatype in oracle
if both have same datatype its moving just fine but with diff datatypes its not. my date string looks like
"Fri, 26 Mar 2004 19:07:56 UTC"
error im getting is
Record 1: Rejected - Error on table "NMDB"."PASTEERRORS", column ADD_DATE.
ORA-01858: a non-numeric character was found where a numeric was expected
Please can anyone tell regarding this ASAP
Thanks in advance
your help is appreciated
|
|
|
|
|
|
|
Re: sqlloader problem in coverting datatypes [message #270959 is a reply to message #270957] |
Fri, 28 September 2007 10:12 |
rk1_23
Messages: 17 Registered: September 2007 Location: us
|
Junior Member |
|
|
Thanks and sorry
im new to this so dont know about it
will not be repeated again
and about my issue
i got a error
Rejected - Error on table "NMDBO"."PASTEERRORS", column AD_DATE.
ORA-01858: a non-numeric character was found where a numeric was expected
can you tell me how to convert a text field to date
Thanks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|