RE: Conditional Insert

2006-08-29 Thread Ravi Kumar.
and insert, another thread inserts a matching record? Do we have any alternative? Thanks, Ravi. -Original Message- From: Douglas Sims [mailto:[EMAIL PROTECTED] Sent: Tuesday, 29 August, 2006 10:48 AM To: Ravi Kumar. Cc: mysql@lists.mysql.com Subject: Re: Conditional Insert Hi Ravi Standard

Re: Conditional Insert

2006-08-29 Thread Douglas Sims
alternative? Thanks, Ravi. -Original Message- From: Douglas Sims [mailto:[EMAIL PROTECTED] Sent: Tuesday, 29 August, 2006 10:48 AM To: Ravi Kumar. Cc: mysql@lists.mysql.com Subject: Re: Conditional Insert Hi Ravi Standard SQL syntax doesn't provide for that. You could wrap the whole

Re: Conditional Insert

2006-08-29 Thread Johan Höök
Subject: Re: Conditional Insert Hi Ravi Standard SQL syntax doesn't provide for that. You could wrap the whole thing in a transaction, possibly in a stored procedure, but this would be rather awkward. However, MySQL has a command called REPLACE which I think will do exactly what you want: http

Re: Conditional Insert

2006-08-29 Thread Douglas Sims
. -Original Message- From: Douglas Sims [mailto:[EMAIL PROTECTED] Sent: Tuesday, 29 August, 2006 10:48 AM To: Ravi Kumar. Cc: mysql@lists.mysql.com Subject: Re: Conditional Insert Hi Ravi Standard SQL syntax doesn't provide for that. You could wrap the whole thing in a transaction, possibly

Re: Conditional Insert

2006-08-29 Thread Chris W
Douglas Sims wrote: Hi Ravi You are correct. I was just sitting here thinking about this after I sent that and realized that what I said was incorrect; the REPLACE command will not do what you want, because it delete a record instead of updating it, it has no way to know what the

RE: Conditional Insert

2006-08-29 Thread Ravi Kumar.
To: Johan Höök Cc: Ravi Kumar.; mysql@lists.mysql.com Subject: Re: Conditional Insert Much better. Good job. Douglas Sims [EMAIL PROTECTED] On Aug 29, 2006, at 1:26 AM, Johan Höök wrote: Hi Ravi, you can take a look at: http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html which might

Re: Conditional Insert

2006-08-28 Thread Douglas Sims
Hi Ravi Standard SQL syntax doesn't provide for that. You could wrap the whole thing in a transaction, possibly in a stored procedure, but this would be rather awkward. However, MySQL has a command called REPLACE which I think will do exactly what you want:

Re: Conditional insert or update.

2005-07-20 Thread Gleb Paharenko
Hello. Please, provide more information on your's application logic. To catch events which occurs for the table use triggers. See: http://dev.mysql.com/doc/mysql/en/triggers.html Unfortunately they're available only in MySQL 5.0.x, which is still beta. Paul Halliday [EMAIL

Re: Conditional insert or update.

2005-07-20 Thread Paul Halliday
Ok, The entire table looks like this: ip | hostname | mac_current | mac_change | port_current | port_change The IP addresses are harvested via netflow (a different table) and or arpwatch (an event). This new table is to augment the current information that is within the netflow tables but