Re: [newbie] Right way to access item in array?

2008-10-28 Thread Gilles Ganault
On Tue, 28 Oct 2008 09:56:11 -0400, Steve Holden <[EMAIL PROTECTED]> wrote: >If you are dealing with a DB API-compliant module then the return value >from the cursor's execute method is undefined, and you need to call one >of the "fetch" methods to extract the retrieved data. Thanks for pointing i

Re: [newbie] Right way to access item in array?

2008-10-28 Thread Gilles Ganault
On Tue, 28 Oct 2008 12:12:26 +0100, Gerhard Häring <[EMAIL PROTECTED]> wrote: >You can do it even in one step with APSW (and pysqlite, and others): > >for isbn, price in cur.execute("select isbn, price ..."): Thanks much guys. For those interested, here's some working code: == import apsw co

Re: [newbie] Right way to access item in array?

2008-10-28 Thread Steve Holden
Gilles Ganault wrote: > Hello > > I'd like to know what the right way is to access an item in a row as > returned by a database: > > = > import apsw > > connection=apsw.Connection("test.sqlite") > cursor=connection.cursor() > > rows=cursor.execute("SELECT isbn,price FROM books WHERE price I

Re: [newbie] Right way to access item in array?

2008-10-28 Thread Gerhard Häring
Diez B. Roggisch wrote: Gilles Ganault wrote: Hello I'd like to know what the right way is to access an item in a row as returned by a database: = import apsw connection=apsw.Connection("test.sqlite") cursor=connection.cursor() rows=cursor.execute("SELECT isbn,price FROM books WHERE pri

Re: [newbie] Right way to access item in array?

2008-10-28 Thread Diez B. Roggisch
Gilles Ganault wrote: > Hello > > I'd like to know what the right way is to access an item in a row as > returned by a database: > > = > import apsw > > connection=apsw.Connection("test.sqlite") > cursor=connection.cursor() > > rows=cursor.execute("SELECT isbn,price FROM books WHERE price

[newbie] Right way to access item in array?

2008-10-28 Thread Gilles Ganault
Hello I'd like to know what the right way is to access an item in a row as returned by a database: = import apsw connection=apsw.Connection("test.sqlite") cursor=connection.cursor() rows=cursor.execute("SELECT isbn,price FROM books WHERE price IS NULL") for row in rows: #Is this ri