List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 22 1999 9:01am
Subject:Re: Detecting when an update found a row but changed no data.
View as plain text  
>>>>> "Scott" == Scott Hess <scott@stripped> writes:

Scott> How about just keeping the exact current REPLACE syntax, and add "NODELETE"
Scott> or something (REPLACE NODELETE ...).  The syntax you describe looks like it
Scott> has two places to put column and value names, meaning that you could say
Scott> things like "If row exists, insert this set of values, otherwise insert
Scott> some other set of values."  I'd rather that you only specified the
Scott> column/value pairs once - if the row exists, overwrite those columns, if it
Scott> doesn't exist, insert it with the default values in the unspecified
Scott> columns.

Scott> Later,
Scott> scott

Hi!

The problem with the above syntax is that its not general enough.

It doesn't handle the cases where you want to have different default
values when you insert a new row or when there is more than one
conflicting row in the result table. In many cases you may also want to
increment something when there is a already a matching row in the
table.

If we added the above, we would still have to add another syntax to
handle the more general cases.

The meaning of replace gets also very 'vague' with REPLACE NODELETE,
its like you are saying 'don't really do a replace'.  In this case it 
would be better with another keyword or something like
'INSERT OR UPDATE table_name'

Regards,
Monty
Thread
Detecting when an update found a row but changed no data.Scott Hess20 Sep
  • Re: Detecting when an update found a row but changed no data.Martin Ramsch20 Sep
  • Re: Detecting when an update found a row but changed no data.Viren Jain20 Sep
    • Re: Detecting when an update found a row but changed no data.Scott Hess20 Sep
      • Re: Detecting when an update found a row but changed no data.Viren Jain20 Sep
      • Re: Detecting when an update found a row but changed no data.gl321 Sep
    • Re: Detecting when an update found a row but changed no data.(James Briggs)21 Sep
      • Re: Detecting when an update found a row but changed no data.Michael Widenius22 Sep
    • Re: Detecting when an update found a row but changed no data.Scott Hess22 Sep
      • Re: Detecting when an update found a row but changed no data.Michael Widenius22 Sep
    • Re: Detecting when an update found a row but changed no data.(James Briggs)22 Sep
    • Re: Detecting when an update found a row but changed no data.Scott Hess22 Sep
      • Re: Detecting when an update found a row but changed no data.Michael Widenius22 Sep
    • Re: Detecting when an update found a row but changed no data.Scott Hess23 Sep
      • Re: Detecting when an update found a row but changed no data.Martin Ramsch23 Sep
    • Re: Detecting when an update found a row but changed no data.Scott Hess23 Sep
      • Re: Detecting when an update found a row but changed no data.Martin Ramsch23 Sep
        • Re: Detecting when an update found a row but changed no data.Michael Widenius23 Sep
          • Re: Detecting when an update found a row but changed no data.gl323 Sep