recordset.keys() issue
Brought to you by:
brujahpriest,
jfranz
winghing@netvigator.com
recordset.keys() duplicate its content when call more
than one time within the same script,
e.g.
while rs.next():
for k in rs.keys():
print "%s : %s" % (k, rs.fields[k].value)
will should multiple duplicate line repeated due to
duplicate of rs.keys() content.
please correct!
Logged In: YES
user_id=395179
This is expected behaivor - calling .keys() returns all of the
column-names in the result-set, reguardless of when called.
If you are seeing multiple copies of the keys in your example,
it is because you have multiple rows in your resultset - and
thus .keys() is being called for each record in your resultset.
If this is not correct, please give us a more detailed example,
with what DB module you are using, and what query you are
using, and some example data from the table(s) in question so
that we may investigate further.