I reported this issue in https://bugs.launchpad.net/webpy/+bug/598080
at 2 months ago, as I got no reply, I am trying to post here.

Although UPDATE ... SET ... ORDER BY .... is valid SQL, current db
module doesn't support this. Current documentation shows arguments for
db.select works for db.update, and there's no mention about ORDER BY
is not working in update.

Supposed to be work:
ret = self.db.update('Articles', vars = val, where = 'bSerial =
$board_id AND aIndex >= $index',
                order = 'aIndex DESC', aIndex = web.SQLLiteral('aIndex
+ 1'))

Result:
ERR: UPDATE Articles SET order = 'aIndex DESC', aIndex = aIndex + 1
WHERE bSerial = 1371L AND aIndex >= 48L

Finally:
ProgrammingError: (1064, "You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'order = 'aIndex DESC', aIndex = aIndex + 1 WHERE
bSerial = 1371 AND aIndex >= 48' at line 1")

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to