Wednesday, April 23, 2008

SQLite- Fetch

Fetch is a SQlite function, it writes in fetch( ). The purpose of this function is to
Return a result record of the query

For example:

  1. fetchall( ) - return all as a tuple
for row in cur.fetchall( ):
print "name",row[0], "address",row[1]

2. fetchone( ) - return first row

for row in cur.fetchone( ):
print "............................

3. fetchmany( size) - return row according to size

for row in cur.fetchmany(200)
print "%s | %s |%s" %row


No comments: