Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: Strange MySQL Problem

by tyndyll (Novice)
on Aug 18, 2004 at 15:55 UTC ( #384013=note: print w/replies, xml ) Need Help??

in reply to Re: Strange MySQL Problem
in thread Strange MySQL Problem

differences between the values allowed for each datatype in dbf's Vs Mysql might shed light?

When the script starts I go through each of the columns and create a base table of a char type, which in MySQL goes holds up to 255 characters. As I go through the data and dump it into a text file I check whether the column can be converted into a number type, and if not check to see if it has the longest string length (if it does update the length). At the end the tables are updated to optimise them for space etc.

I'm preety sure the problem isn't a type one - using the MySQL client it inserts fine. I thought it was maybe a timing issue - Looking at the last line of the shortened data shows that the last few columns are null.. is the script moving faster than it is writing? If so why did

parse_data(); sleep 10; query('LOAD DATA INFILE "'.$temp.'" INTO TABLE '.$table.' FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY "\"" LINES TERMINATED BY "\r\n"'); unlink($temp);
not work?

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://384013]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2023-06-10 01:02 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (36 votes). Check out past polls.