- Notifications
You must be signed in to change notification settings - Fork10
Basic cursor usage - fetchall / fetchone returning List of Tuples instead of Row objects?#65
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Disclaimer: I am 100% completely new to python, which is why I've posted this as a discussion instead of an issue. But I am a SQL Server developer, so when I saw this new driver announcement, I decided to start learning it. I installed Python v3.13.3 and I'm literally just trying to re-create the samples used in the documentation and they are not working. The query runs fine, I can see data populating into the variable after fetching. But it seems the data type returned by I'm running this: frommssql_pythonimportconnectconn=connect("Server=localhost;Database=master;UID=sa;PWD=MyPassword;Encrypt=no;")cursor=conn.cursor()cursor.execute("SELECT [type], row_count = COUNT(*) FROM sys.objects GROUP BY [type]")row=cursor.fetchone()row.row_count Which results in...
The documentation says that So, I understand what I need to do to make this work in regard to accessing the values I need using indexes rather than names. But I don't understand why the fetch commands are returning tuples and lists of tuples instead of this |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 2 comments
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hi@chadbaldwin Thank you for connecting with us, appreciate you for using this driver. We are triaging this issue and will revert in a day or two on this issue. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hi@chadbaldwin We acknowledge issues in the documentation and corresponding intended behavior. We are now in the process of fixing this issue. This will be released in our upcoming release. Necessary changes will be done on the documentation as well. Thank you again for reporting this problem. |
BetaWas this translation helpful?Give feedback.