![]() |
2 queries how to use "row" - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: 2 queries how to use "row" (/thread-13744.html) |
2 queries how to use "row" - zxcv - Oct-30-2018 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 ? RE: 2 queries how to use "row" - nilamo - Oct-30-2018 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? |