yes, the PN field is a part number and is intently unique. But this seems to load into CUST_ID=NULL, instead of CUST_ID=1. What can I do to update only for CUST_ID=1?
-----Original Message----- From: Thomas Spahni [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 4:26 AM To: john Cc: MySQL Lists Subject: RE: Beginner - Updating a Table from a File On Wed, 28 Nov 2001, john wrote: > mysql> load data local infile '/tmp/Parts.txt' > -> replace > -> into table Parts > -> fields > -> optionally enclosed by '"' > -> terminated by ',' > -> ('PN','APN','C','Q','D') > Query OK, 100946 rows affected (39.66 sec) > Records: 100946 Deleted: 0 Skipped: 0 Warnings: 2 > > This has only been appended! There has been no update! Effectively, I have > just doubled the size of my inventory. I could have accomplished that with > out using REPLACE. I believe the reason for not replacing the data is the > command does not know how to align itself with CUST_ID = '1'. Does this > sound correct? John, is one of your columns in ('PN','APN','C','Q','D') a unique key? REPLACE will check for this. Thomas --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php