SQL syntax

2008-01-07 Thread Jeremy Stephens
Why is the UPDATE syntax so different from INSERT? If I'm constructing a SQL statement to insert or update based on the existence of a row in some code, I have to have two completely different cases to handle it. What were the SQL creators thinking? What's strange is that I've been working

Re: SQL syntax

2008-01-07 Thread Peter da Silva
On 2008-01-07, at 13:49, Jeremy Stephens wrote: Why is the UPDATE syntax so different from INSERT? Because the people designing SQL were devotees of the English- Likeness Monster. I've dumped enough hate about that on this list recently. Though that probably answers the question of WHY IS

Re: SQL syntax

2008-01-07 Thread Jeremy Stephens
When I'm generating SQL I just maintain a list of columns and values (or a hash, or a pair of lists, or whatever is convenient for the language) and run it through a map/apply operation to generate the right syntax at the last minute. I do that as well. Most recently I used that technique to