472,353 Members | 1,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

load data infile - fails to load my db2 del (ascii) file

hi all,


right now i'm trying to migrate from db2 running under linux to mysql v5.1.

i manage to export out the db2 structure & data into a del (ascii) file.
but when i try to load the data from the del file to mysql table, it generate an error.

below is the load data infile syntax i use =
Expand|Select|Wrap|Line Numbers
  1. LOAD DATA INFILE 'C:\\Migration\\del\\TABLE01.del' INTO TABLE TABLE01 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';
  2.  

and below is the sample layout of del file (in the above case is TABLE01.del) =
Expand|Select|Wrap|Line Numbers
  1. 1,0,"2007-07-31 00:25:12"
  2. 2,0,"2007-07-31 14:09:00"
  3. 3,0,"2007-07-31 00:00:00"
  4. 4,0,"2007-07-31 00:00:00"
  5. 5,0,"2007-07-31 00:00:00"
  6.  

and below is the TABLE01 structure =
Expand|Select|Wrap|Line Numbers
  1. FieldName, Type, Null, Primary
  2. ------------------------------------------------------
  3. MY_TABLEID, int(11), NO, PRIMARY KEY
  4. CNTS, int(11), NO, NOT PRIMARY KEY
  5. INSERT_DATE, datetime, NO, PRIMARY KEY
  6.  

the error i encounter is =
ERROR 1292 (22007): Incorrect datetime value: '"2007-07-31 00:25:12".....


i do some trick by trying to remove the qoute sign from "2007-07-31 00:25:12" so the del file become =
Expand|Select|Wrap|Line Numbers
  1. 1,0,2007-07-31 00:25:12
  2. 2,0,2007-07-31 14:09:00
  3. 3,0,2007-07-31 00:00:00
  4. 4,0,2007-07-31 00:00:00
  5. 5,0,2007-07-31 00:00:00
  6.  
And i do load data infile again with same command =
Expand|Select|Wrap|Line Numbers
  1. LOAD DATA INFILE 'C:\\Migration\\del\\TABLE01.del' INTO TABLE TABLE01 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n';
  2.  
and it was successful.


to me it is very strange, since i can do a sql insert using "2007-07-31 00:25:12" for example: insert into TABLE01 values (11, 22, "2007-07-31 00:25:12")
successfully without any error!!!
in fact, when i use a MySQL Administrator tools, and i export out the data from TABLE01 into CSV, then i found that the structure is exactly the same with del file generated by db2.

do i make any mistake??

or do i need to initialize something before i call
Expand|Select|Wrap|Line Numbers
  1. LOAD DATA INFILE 'C:\\Migration\\del\\TABLE01.del' INTO TABLE TABLE01 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' ...?????
  2.  
Any help is appreciated.
Thank you.


Regards,
Lanes
Nov 7 '07 #1
0 2058

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Bruce A. Julseth | last post by:
When I execute this SQL statement in my PHP code, I get an error "File '.\Address.txt' not found (Errcode: 2)" $File =...
3
by: hall | last post by:
I have a problem with my design of a templatized class. I'm trying to figure out how to load and save the data inside it, but can't. My class looks...
0
by: Donald Tyler | last post by:
Then the only way you can do it that I can think of is to write a PHP script to do basically what PHPMyAdmin is trying to do but without the LOCAL...
1
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA...
4
by: Bruce A. Julseth | last post by:
I have three users with access to my test MySQL databases, root plus two others. The following PHP code only works when the user is root. Otherwise...
3
by: nsh | last post by:
mailing.database.mysql, comp.lang.php subject: does "LOAD DATA" EVER work?!? I've tried EVERYTHING! version info: my isp is running my web page...
4
by: marora | last post by:
I have created class definition which contains a charater pointer as one of it's data memeber. The objective is to read some data from a file,...
4
by: CPD | last post by:
From PHP, doing a DROP TABLE and a CREATE TABLE is successful, but doing a LOAD FILE keeps failing, with the error "Access denied for user...
5
by: Justin | last post by:
Hi, im facing a problem here. First of all here is my program requirement. I got a .csv file with thousands of records inside, i need to import...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.