In article <87ekywbqz1.fsf@stark.dyndns.tv>,
Greg Stark <gsstark@mit.edu> writes:
> Out of curiosity, what does the mysql syntax look like? How would you handle
> something where the insert and update were quite different like:
> INSERT INFO foo (pk,value,count,date_ins) values (?,?,1,now())
> OR UPDATE foo set value=?, count=count+1, date_upd=now() where pk = ?
You can't. The only thing MySQL has to offer is
REPLACE INTO tbl_name [(col_name,...)] VALUES (expr,...)
`REPLACE' works exactly like `INSERT', except that if an old record in
the table has the same value as a new record on a `UNIQUE' index or
`PRIMARY KEY', the old record is deleted before the new record is
inserted.