Brad
Brad

Reputation: 12262

import xml data into mysql, how to manage modifications to the file

I'll be importing data from another website into my db, the external data I'll be reading before importing into my database is xml.

I'll be running the script every 15 minutes to check the xml file.

What is the best way to go about inserting/modifying/deleting data?

I know I can just delete all the data from the database table before the importing the data from the xml but there has to be a more efficient way of doing this.

I appreciate the help.

Upvotes: 1

Views: 465

Answers (1)

Marcus Davies
Marcus Davies

Reputation: 248

Why not simply use the Truncate keyword in your statement?

TRUNCATE TableName;INSERT INTO....

regards

Upvotes: 1

Related Questions