Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2 queries how to use "row"
#1
New to Python.

Looping row by row through query (cursor1) with fetchone() and getting values using "row", like row.idno.
Inside the main loop, made another connection and query (cursor2) to look up a value in another table that also has field idno.

How do I get values in cursor2, like having row1 for cursor1 and row2 for cursor2, like row1.idno and row2.idno ?
Reply
#2
You should be able to do it exactly as you described. But if the two queries are related, why not just join them together in sql to have a single resultset?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Too many queries? lorasf 6 918 Jul-04-2023, 04:27 AM
Last Post: lorasf
  Text File Manipulation Queries? JustJeff 2 2,078 Apr-10-2021, 08:12 PM
Last Post: JustJeff
  Pyhton and SQL Lite3 Data Queries compumarsh 4 3,042 Sep-21-2018, 02:29 PM
Last Post: compumarsh
  How Does pyspark deal with Spaces in Queries cpatte7372 3 2,888 Jul-31-2018, 09:53 PM
Last Post: micseydel
  Slow execution of MS Access queries Anirudh_Avantsa 4 4,330 Feb-12-2018, 05:01 PM
Last Post: nilamo
  Xpath queries sairam132033 6 4,859 Dec-06-2017, 11:02 PM
Last Post: Larz60+
  Problem with Python, MySQL and Multi-threading queries zagk 1 11,812 Jul-01-2017, 12:15 AM
Last Post: zagk

Forum Jump:

User Panel Messages

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