Hi Michael, this drop-in is great, it does exactly what I need. It just has a small problem in that the variable 'rownum' is not allowed in oracle, it produces a DatabaseError: (DatabaseError) ORA-00923: FROM keyword not found where expected Replacing 'rownum' with 'ora_rn' or something similar fixes this problem.
On Dec 9, 5:25 pm, Michael Bayer <mike...@zzzcomputing.com> wrote: > > the recipe for built in ROW_NUMBER() for LIMIT/OFFSET should be a drop in and > is at: > > http://www.sqlalchemy.org/trac/wiki/UsageRecipes/WindowFunctionsByDef... > > applying to certain domain objects only would be a little more involved. > You'd probably want to place some kind of "hint" on the statement that the > custom > compiler picks up on, or perhaps it looks at the table being > selected to make this determination. What would be the safest way to get access to the table/model for which the query was created? I found that "element._froms[0]" is a pointer to my table, is this a good/stable/portable way to get hold of it? This way I could just instrument my model (aka hint) so see whether I need the ROW_NUMBER approach or not. Ralph -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.