Home » RDBMS Server » Server Utilities » How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC)
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 Go to next message
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 Go to previous messageGo to next message
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 #270798 is a reply to message #270705] Fri, 28 September 2007 01:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

Regards
Michel
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #270951 is a reply to message #270950] Fri, 28 September 2007 10:01 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/m/270948/74940/#msg_270948
Why did you open a new thread with duplicate question?
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF) [message #270952 is a reply to message #270948] Fri, 28 September 2007 10:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
At least 2 errors:
1/ TZD is not a format for to_date but to_timestamp
2/ This is not the correct way to call a [PL/]SQL function in SQL*Loader, see Applying SQL Operators to Fields

Regards
Michel
Re: sqlloader problem in coverting datatypes [message #270953 is a reply to message #270950] Fri, 28 September 2007 10:02 Go to previous messageGo to next message
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 #270955 is a reply to message #270953] Fri, 28 September 2007 10:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
STOP multiposting.

Regards
Michel
Re: sqlloader problem in coverting datatypes [message #270956 is a reply to message #270950] Fri, 28 September 2007 10:08 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Record 1: Rejected - Error on table "NMDB"."PASTEERRORS", column ADD_DATE.

What is column name? "AD_DATE", "ADD_DATE", or ???????
Re: sqlloader problem in coverting datatypes [message #270957 is a reply to message #270953] Fri, 28 September 2007 10:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
ASAP

This is not welcome.

Read my post above.

Regards
Michel
Re: sqlloader problem in coverting datatypes [message #270958 is a reply to message #270956] Fri, 28 September 2007 10:10 Go to previous messageGo to next message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
it is ad_date column with date as a data type in oracle and text in acess/.csv file
so can you help to convert text to date while loading
Thanks
Re: sqlloader problem in coverting datatypes [message #270959 is a reply to message #270957] Fri, 28 September 2007 10:12 Go to previous messageGo to next message
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
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270960 is a reply to message #270705] Fri, 28 September 2007 10:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
If you would read & FOLLOW all the posting guidelines as found in the #1 STICKY post found at top of this forum, your problem might get solved sooner rather than later.
use <code tags> & post DDL to create your table(s) along with sample input data.
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270963 is a reply to message #270960] Fri, 28 September 2007 10:27 Go to previous messageGo to next message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
Record 1: Rejected - Error on table "NMDB"."ERRORS", column AD_DATE.
ORA-01858: a non-numeric character was found where a numeric was expected


Table "NMDB"."ERRORS":
  0 Rows successfully loaded.
  1 Row not loaded due to data errors.
  0 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.

help me
i want to load string(text) date into date datatype

[Updated on: Fri, 28 September 2007 10:29]

Report message to a moderator

Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270966 is a reply to message #270963] Fri, 28 September 2007 10:30 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Fri, 28 September 2007 17:09

Read my post above.

Regards
Michel


Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270969 is a reply to message #270966] Fri, 28 September 2007 10:34 Go to previous messageGo to next message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
hi
i tried to change it to to_timestamp
but no use
the error im getting is

SQL*Loader-350: Syntax error at line 14.
Expecting "," or ")", found "to_timestamp".
          ad_date to_timestamp('DY,DD MON YYYY,hh24:mi:ss TZD'),
                   ^
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270971 is a reply to message #270969] Fri, 28 September 2007 10:38 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You didn't read the second part.

Regards
Michel
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270981 is a reply to message #270971] Fri, 28 September 2007 10:55 Go to previous messageGo to next message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
Yes
i did

Thanks
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270985 is a reply to message #270981] Fri, 28 September 2007 11:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So why didn't you apply what's inside?

Regards
Michel
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270991 is a reply to message #270985] Fri, 28 September 2007 11:58 Go to previous messageGo to next message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
hi all
can anyone know the below error
SQL*Loader-282: Unable to locate character set handle for character set ID (2000).


i got this when i try to load a .csv file into oracle database

Thanks
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270993 is a reply to message #270991] Fri, 28 September 2007 12:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is another question, create another topic.

By the way, was the previous problem solved?

Regards
Michel

[Updated on: Fri, 28 September 2007 12:08]

Report message to a moderator

Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #270994 is a reply to message #270705] Fri, 28 September 2007 12:22 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Results 1 - 6 of 6 for SQL*Loader-282: Unable to locate character set handle for character set ID (2000
GOOGLE is your friend, but only when you use it!
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #271020 is a reply to message #270994] Fri, 28 September 2007 14:09 Go to previous messageGo to next message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
Hi
I searched in google but no use
So can you suggest me anything regarding Character set ID(2000)
What it is? What is the character handle set
how do i correct to get my code run properly

Thanks
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #271022 is a reply to message #270993] Fri, 28 September 2007 14:11 Go to previous messageGo to next message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
Hi
yes i solved the previous issue by removing the TZD from date mask
and can you suggest me about the character set ID(2000)
How to correct to make it run

Thanks
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #271026 is a reply to message #271022] Fri, 28 September 2007 14:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
1/ So why didn't you inform people who tried to help and possibly thank them for the time they spent?
2/ Open a new topic for your new question.

Regards
Michel
Re: How to properly load CHAR from CSV file to DATE column? (split and renamed by LF and merge by MC [message #271028 is a reply to message #271026] Fri, 28 September 2007 14:21 Go to previous message
rk1_23
Messages: 17
Registered: September 2007
Location: us
Junior Member
hi
i told Thanks just now
just now the problem got fixed
il open another post for the above problem
Previous Topic: Sql Loader log file result in table? (merged)
Next Topic: Character Set ID(2000)?
Goto Forum:
  


Current Time: Mon Jul 01 09:10:36 CDT 2024