What would that statement do? I'm not sure I see what happens. For instance:
UPDATE table_foo SET value_bar=baz ORDER BY id desc; What does the order by do in that statement? The update doesn't return results, so it's unclear what order is being manipulated. By the way, you can always do db.query if something is unsupported by the basic database module. On Aug 4, 1:07 am, peremen <[email protected]> wrote: > I reported this issue inhttps://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.
