I think I do not grasp your point: if you delete one row you do not have empty id although it increments so there is no lost time when reading the db and you do not even heve th chance to access the "deleted" id. Or maybe I misunderstood your case..
carlo On 20 Giu, 13:57, Fauché JM <jm.fau...@free.fr> wrote: > Hello, > I my application ,I have a db in which some row are frequently > deleted, so if for each new data I save it in db (automatiquely > incremented) I will have a lot of data and a lot of id "empty". > I think that in this situation when reading data , the program loose > time ..? > So I imagine a piece of code where first I seach for free places for > using the fist one for new data: > > libre=(db.somedata.value==0) > if len(db(libre).select())>0: # On free > place > le_libre = db(libre).select()[0] > db(db.somedata.id==le_libre.id).update > (value=newvalue) > else: # On new > place > somedata_id=db.somedata.insert(value=newvalue) > > May be there is a simple way ? (for exemple a > function ...insert_onfree...) > > Thank for your comments > Jean-Marc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---