I would use cfftp to read the file and then use SQL's BCP.exe to import it
into SQL.

Warmest Regards,
 
Phillip B. Holmes
http://phillipholmes.com



 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 28, 2006 1:42 PM
To: CF-Talk
Subject: Reading an SQL file via HTTP request and importing it.

I'm working on a personal project and I wanted to run something by everyone
for reference.

I play a game called Travian (www.travian.com). It's a sort of browser based
MMORPG. The game has multiple servers, with each server having about 40,000
or so accounts. The makers of the game allow download of an SQL file
containing 40,000 INSERT statements corresponding to all of the basic player
information.

I imported all of the map data from a few days ago and set about writing a
little tool that allows me (and other players) to specify their coordinates
and map size and generate a map of their area for perusal. You can see it in
action
here:
http://www.commadelimited.com/travian.

Enter 62,-213 for coords for testing. For expediency's sake, I deleted all
of the data that was outside "my" area

Now, on to the real question. This game information is time sensitive,
changing on a minute by minute basis, but the SQL file is generated once per
day. I'd like to read the SQL file from the server and totally replace the
data contained in the database with the new data.

I can think of a way to do this, using CFHTTP, then looping over the
information, but there's so many records in the nearly 4mb SQL that I'm
leery of doing that. Does anyone have suggestions as to the most effective,
processor efficient way of doing this import?

Here's a link to the file if you're interested:
http://s5.travian.com/map.sql


thanks in advance!
andy matthews



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:241690
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to