Hi:
In my install, I often will work on 100's of new entries, upload them as a txt file, and then put them into the database with Load Infile, like thus:
LOAD DATA INFILE 'Arr.txt' REPLACE INTO TABLE `Links` FIELDS TERMINATED BY '|' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 0 LINES
Works great.
Now I want to add some new data to existing entries. I could download all the data, and then re-upload with the above comant... but why should I if I am only adding an image link? Why not just get the ID, Issue, and put the image with it, and insert that?
So I tried:
LOAD DATA INFILE 'Arr.txt' REPLACE INTO TABLE `Links` (ID, Issue, Image) FIELDS TERMINATED BY '|' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 0 LINES
which did, in fact, insert all three fields appropriately... however, it DELETED all the other info! Luckily, I was practicing on a non-needed row, and only one, so I did not kill anything important!
So, my question is, how can I load an infile and just insert SOME data, w/o deleting all the rest? Or should I give it up, and d/l and insert ALL the data?
dave
Big Cartoon DataBase
Big Comic Book DataBase
In my install, I often will work on 100's of new entries, upload them as a txt file, and then put them into the database with Load Infile, like thus:
LOAD DATA INFILE 'Arr.txt' REPLACE INTO TABLE `Links` FIELDS TERMINATED BY '|' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 0 LINES
Works great.
Now I want to add some new data to existing entries. I could download all the data, and then re-upload with the above comant... but why should I if I am only adding an image link? Why not just get the ID, Issue, and put the image with it, and insert that?
So I tried:
LOAD DATA INFILE 'Arr.txt' REPLACE INTO TABLE `Links` (ID, Issue, Image) FIELDS TERMINATED BY '|' ESCAPED BY '\\' LINES TERMINATED BY '\n' IGNORE 0 LINES
which did, in fact, insert all three fields appropriately... however, it DELETED all the other info! Luckily, I was practicing on a non-needed row, and only one, so I did not kill anything important!
So, my question is, how can I load an infile and just insert SOME data, w/o deleting all the rest? Or should I give it up, and d/l and insert ALL the data?
dave
Big Cartoon DataBase
Big Comic Book DataBase