From: Paul DuBois <[EMAIL PROTECTED]>
To: "Jessica Svensson" <[EMAIL PROTECTED]>,mysql@lists.mysql.com
Subject: Re: LOAD DATA, Ignore in SET?
Date: Sat, 28 Jan 2006 17:59:23 -0600

At 23:42 +0000 1/28/06, Jessica Svensson wrote:
I'm doing load data a few times a day via cron and using this:

LOAD DATA
LOCAL
INFILE '/file.txt'
INTO TABLE input
[...]
(@partnumb, description, price)
SET product_id=(SELECT product_id FROM products WHERE [EMAIL PROTECTED])
[...]

Now if the partnumber does NOT exists in the products table the product_id gets the value 0 (zero). I would like to have it ignore if there is not match, so i don't need to run a seperate query to delete everything with product_id = 0.

If by "ignore it" you mean "skip the input line and do not load it,"
you can't do that.

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

Actually i dont care how it's done i just don't want it in my database. Ignore, Skip, instantly delete... whatever :) Is it impossible?

_________________________________________________________________
Nyhet! MSN Messenger i Mobiltelefonen! http://mobile.msn.com/


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to