Hi Massimo,

Tried the db.commit and I still get the error. Not sure what is
causing it. I have another SQL search query which works fine. I have
included code fragments from both functions for comparison. Any help
would be appreciated. Thanks.

# SQL search query -- Web2py 1.56, Oracle 10g #
#---- This code throws errors if you have more than 10 records in the
results ---#
    # Search code for freezer
    if request.vars.freezer!= '1':   # '1' = None
      s=s(db.packing.freezer==request.vars.freezer)
      r = db(db.freezer.id == request.vars.freezer).select
(db.freezer.name)
      for ra in r:
        t = t + ' freezer=' + str(ra.name)

    # Search code for rack
    if request.vars.rack!= '1':
      s=s(db.packing.rack==request.vars.rack)
      r = db(db.rack.id == request.vars.rack).select(db.rack.name)
      for ra in r:
        t = t + ' rack=' + str(ra.name)

    # execute query
    if request.vars and t != '':
      rows=s.select(orderby=db.packing.name)
      #db.commit()
      total = len(rows)
    else:
      rows=[]
      total = len(rows)
    return dict(form=form,rows=rows, total=total, t=t)

# -- this code works  --#
    if request.vars.name:
      location = db((db.packing.freezer==db.freezer.id)&
(db.packing.rack==db.rack.id))
      searchStr = str(request.vars.name).upper()
      # search query for defined fields
            record=location(db.freezer.name.upper().like('%'+searchStr
+'%') | db.rack.name.upper().like('%'+searchStr+'%')
                                     ).select(db.freezer.name,
db.rack.name)

    else:
      record = []
    total=len(record)
    return dict(form=form,record=record, total=total,
query=request.vars.name)

#------end of code --------#


On Jul 16, 4:54 pm, mdipierro <[email protected]> wrote:
> trydb.commit() after the first fetch.
>
> On 16 Lug, 15:07, DJ <[email protected]> wrote:
>
> > Hi there,
>
> > I get these errors when I run a search query (retrieve multiple rows),
> > but not when I do a single row retrieval (such as viewing a record).
> > Any suggestions or methods to get around this?
>
> > -Sebastian
>
> > Traceback (most recent call last):
> >   File "C:\Documents and Settings\sjayaraj\Desktop\web2py_src\web2py
> > \gluon\restricted.py", line 98, in restricted
> >     exec ccode in environment
> >   File "C:\Documents and Settings\sjayaraj\Desktop\web2py_src\web2py
> > \applications\myapp/views/viewer/search.html", line 67, in <module>
> >   File "C:\Documents and Settings\sjayaraj\Desktop\web2py_src\web2py
> > \gluon\globals.py", line 84, in write
> >     self.body.write(xmlescape(data))
> >   File "C:\Documents and Settings\sjayaraj\Desktop\web2py_src\web2py
> > \gluon\html.py", line 97, in xmlescape
> >     data = str(data)
> > ProgrammingError: LOB variable no longer valid after subsequent fetch
>
> > Version: 1.65.5
> > CX_Oracle docs for LOB:http://cx-oracle.sourceforge.net/html/lob.html
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to