Limitby clause works when you select db.table.ALL It must be possible to use aliases carefully to be able to select eequired fields only.
On 28 фев, 16:02, mdipierro <[email protected]> wrote: > No limitby is not working on Oracle with Joins. This is because Oracle > does not support pagination. We do it anyway using a trick (three > nested select as suggested by the oracle docs) but the trick breaks > down with joins. > > On Feb 27, 11:50 am, SergeyPo <[email protected]> wrote: > > > If you remove limitby it works. I reported this error about 6 months > > ago, tried many workarounds and thought we fixed it. But somehow it > > appeared at my client's site. Versions 1.65 and current 1.75 > > downloaded this week. > > > On Feb 27, 8:20 pm, Thadeus Burgess <[email protected]> wrote: > > > > Just going out on a limb here. > > > > Have you tried the query where it selects all columns instead of just > > > name and komment? > > > > -Thadeus > > > > 2010/2/27 SergeyPo <[email protected]>: > > > > > SELECT headers1.name, alarms1.komment FROM (SELECT w_tmp.*, ROWNUM > > > > w_row FROM (SELECT headers1.name, alarms1.komment FROM headers1, > > > > alarms1 WHERE headers1.id=alarms1.header ORDER BY headers1.id, > > > > alarms1.id) w_tmp WHERE ROWNUM<=5) headers1, alarms1 WHERE > > > > headers1.id=alarms1.header AND w_row > 0; > > > > > Traceback (most recent call last): > > > > File "c:\web2pyNEW\gluon\restricted.py", line 173, in restricted > > > > exec ccode in environment > > > > File "c:/web2pyNEW/applications/test/controllers/default.py", line 11, > > > > in <module> > > > > File "c:\web2pyNEW\gluon\globals.py", line 96, in <lambda> > > > > self._caller = lambda f: f() > > > > File "c:/web2pyNEW/applications/test/controllers/default.py", line 7, > > > > in index > > > > data = db(db.headers1.id==db.alarms1.header).select(db.headers1.name, > > > > db.alarms1.komment, limitby=(0, 5)) > > > > File "c:\web2pyNEW\gluon\sql.py", line 3042, in select > > > > rows = response(query) > > > > File "c:\web2pyNEW\gluon\sql.py", line 3037, in response > > > > db._execute(query) > > > > File "c:\web2pyNEW\gluon\sql.py", line 970, in <lambda> > > > > oracle_fix_execute(a,self._cursor.execute) > > > > File "c:\web2pyNEW\gluon\sql.py", line 603, in oracle_fix_execute > > > > return execute(command[:-1], args) > > > > DatabaseError: ORA-00904: "HEADERS1"."ID": invalid identifier > > > > > On 26 фев, 21:22, Thadeus Burgess <[email protected]> wrote: > > > >> please print the output of > > > > >> db(db.headers.id == db.alarms.header)._select(db.header.name, > > > >> db.alarms.komment, limitby=(0,5)) > > > > >> -Thadeus > > > > >> On Fri, Feb 26, 2010 at 12:00 PM, SergeyPo <[email protected]> wrote: > > > >> > Limitby clause still is not working with Oracle backend when used in > > > >> > queries that have any kind of join, left or inner. > > > > >> > db.define_table('headers', > > > >> > SQLField('name', 'string') > > > >> > ) > > > > >> > db.define_table('alarms', > > > >> > SQLField('header', db.headers), > > > >> > SQLField('komment', 'string') > > > >> > ) > > > > >> > data = db(db.headers.id == db.alarms.header).select( > > > >> > db.header.name, db.alarms.komment, limitby=(0, 5) > > > >> > ) > > > > >> > ...gives Oracle error "wrong identifier 'alarms'.'headers' > > > > >> > But in fact this is not matter of wrong fields, problem is with > > > >> > limitby construction. > > > > >> > Queries using left join also give error, but another one. In both > > > >> > cases error message is quite irrelevant to real problem. E.g. I need > > > >> > a > > > >> > pretty complex query with groupby, count and left join... Error > > > >> > message in this case will be 'this is not valid groupby clause'. > > > >> > Obviously, problem is in aliases that are used for nested queries > > > >> > required by Oracle to limit rows in result set. > > > > >> > Any help with DAL or workarounds please! I am ready to help with > > > >> > testing. > > > > >> > -- > > > >> > You received this message because you are subscribed to the Google > > > >> > Groups "web2py-users" 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 > > > >> > athttp://groups.google.com/group/web2py?hl=en.-Скрыть цитируемый > > > >> > текст - > > > > >> - Показать цитируемый текст - > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "web2py-users" 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 > > > > athttp://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups "web2py-users" 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/web2py?hl=en.

