Python Forum
iterate through query result
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iterate through query result
#9
It's not clear what DB you use and what package/connector is used to connect. Also, after you initial code it's not clear if you do any changes.
generally you may control what is returned by when you query the database -tuple, dict, namedtuple...
e.g. for MySQL connector https://dev.mysql.com/doc/connector-pyth...ursor.html

of course, the option to simply work with dict.values() is also possible as suggested by @deanhystad
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
iterate through query result - by bigt - Mar-25-2020, 06:16 PM
RE: iterate through query result - by bigt - Mar-25-2020, 07:55 PM
RE: iterate through query result - by deanhystad - Mar-25-2020, 08:03 PM
RE: iterate through query result - by bigt - Mar-25-2020, 08:14 PM
RE: iterate through query result - by deanhystad - Mar-25-2020, 09:28 PM
RE: iterate through query result - by bigt - Mar-25-2020, 11:12 PM
RE: iterate through query result - by bigt - Mar-26-2020, 02:27 PM
RE: iterate through query result - by deanhystad - Mar-26-2020, 03:53 PM
RE: iterate through query result - by buran - Mar-26-2020, 03:57 PM
RE: iterate through query result - by bigt - Mar-26-2020, 04:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Write SQLite query result to file hjk6734 1 2,728 May-27-2020, 12:17 PM
Last Post: menator01
  python code (embedded in Redshift) to return result of the query Mel 0 2,943 Aug-24-2018, 06:12 PM
Last Post: Mel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020