Re: Suggestions for alternate UPDATE command syntax

From: Neo <neo55592_at_hotmail.com>
Date: 6 Apr 2005 09:50:59 -0700
Message-ID: <1112806259.205399.269510_at_o13g2000cwo.googlegroups.com>


> >(UPDATE mary color yellow > purple)
>
> Personally I would vote for "=". If that already has a
> reserved meaning I would go for ":=" or something similar.

Thanks for your input. In my (unorthodox) way of thinking, in a db where it is desirable to eliminate redundancy, no two things are ever equal unless they are in fact the same thing. Thus var1 (a thing) and var2 (another thing) are never equal but they may refer to the same thing. In the sentence "mary color yellow" the third element refers to yellow but is not equal to yellow. Afterwards, the third element refers to purple but is not equal to purple. Therefore I was hesitant about "... yellow = purple". Of the two, := seems more appropriate as it highlights that distinction. I think the = might be better reserved for "IF (var1 refersTo *) = (var2 refersTo *) THEN ...". Note var1 could have other attributes (ie var1 createdBy bob on 4/1/05).

Since mary can have 0 to many colors, I was searching for a syntax that would be easy for the user, provide flexibility and yet be processible? Flexibility might mean the ability to change a particular color, all her colors, etc. Easy might mean the syntax is closest to typical English as follows:

CHANGE/UPDATE/SET mary's color [FROM] yellow TO purple. or
CHANGE/UPDATE/SET mary's color(s) [EQUAL?] TO purple.

The FROM/TO seemed most natural (to me) thus the >. This shouldn't conflict with the comparison greater-than because such statements would begin with a different command (ie IF x > y THEN ...).

Also consider the user changing "john flew airplane to hawaii" TO "john flew airplane over hawaii". Note, user changes to TO over, and this is why I chose not to use TO currently. In the current syntax it would be:

(UPDATE john flew airplane to > over)

In your suggested syntax, it would be:

(UPDATE john flew airplane to := over)

Further thoughts appreciated. Received on Wed Apr 06 2005 - 18:50:59 CEST

Original text of this message