Re: Unpacking of query result
- From: DarkBlue <nomail@xxxxxxxxxxx>
- Date: Sun, 30 Apr 2006 16:30:00 +0800
Hello
Following part of an database query works fine :
self.cur=con1.cursor
self.cur.execute('select a,b,c,d from t1')
for (a,b,c,d) in self.cur:
print a,b,c,d
but how to do this:
self.cur.execute(sql_select_text_put_in_at_runtime)
for (whatever_was_in_the_select_text_part_of_the_query) in self.cur:
print 'returned result set'
Will it be necessary to parse the sql string and find any possible
return columns or is there a better way so that the query can be used
generically , that is without knowing at coding time
what or how many columns will be returned ?
Thanks
Db
.
- Follow-Ups:
- Re: Unpacking of query result
- From: Fredrik Lundh
- Re: Unpacking of query result
- Prev by Date: Re: basic python programing
- Next by Date: Re: time conversions [hh:mm:ss.ms <-> sec(.ms)
- Previous by thread: basic python programing
- Next by thread: Re: Unpacking of query result
- Index(es):