Per avanzare hai provato nextset ? Altrimenti fai una cosa del tipo salvi il cursore prima di fare il retrieve di un record
prev_record = cursor ricevi il record e diventa il tuo curr_record il next_record lo ottieni rifacendo una fetch. Un vecchio amico, ormai a milano. Saluti Gianluca Paolo Amodio ha scritto: > Buon giorno a tutti. > Una breve domanda. > Eseguita una query e ritornati i risultati ho la necessità di avanzare, > o retrocedere, di un record (i risultati popolano dei campi in wxPython). > Attualmente e per il momento ho creato una funzione che, ricevuto il > valore attuale del record (in realtà del campo ID), effettua una nuova > query. > Il sistema mi sembra macchinoso. > Esiste qualche cosa di migliore? > > eccovi un estratto del codice: > > def getdanninext(x): > db = dbi() > # create a cursor > cursor = db.cursor() > S=("SELECT * FROM `" + CY + "` ORDER BY ID DESC") > cursor.execute(S) > # get the number of rows in the resultset > numrows = int(cursor.rowcount) > startr = int(x) > # get and display one row at a time > for x in range(startr,numrows): > ListNext = cursor.fetchone() > cursor.close() > return ListNext > > Grazie > > > Paolo Amodio > [EMAIL PROTECTED] > www.dixienet.it > > > > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python > _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python