How to output the rows which are affected using SQLAlchemy in Python?

0 votes

Hi all. Pretty simple question - How do I go about in getting the number of affected rows using SQLAlchemy?

Also, wanted to know what the equivalent for cursor.rowcount is in SQLAlchemy Python.

Using this for a project of mine.

All help appreciated!

Feb 15 in Python by Anirudh
• 2,060 points
47 views

1 answer to this question.

0 votes

Hi, good question. This is actually not stated anywhere in the official documentation but the ResultProxy object actually has a rowcount property built into it natively.

You can make use of the rowcount property to serve your needs.

Hope this helped!

answered Feb 15 by Nymeria
• 3,500 points

Related Questions In Python

0 votes
1 answer

How to correctly return an a dictionary as an output in zappier code using python?

David here, from the Zapier Platform team. ...READ MORE

answered Dec 3, 2018 in Python by charlie_brown
• 7,710 points
85 views
+2 votes
3 answers

How can I play an audio file in the background using Python?

down voteacceptedFor windows: you could use  winsound.SND_ASYNC to play them ...READ MORE

answered Apr 3, 2018 in Python by charlie_brown
• 7,710 points
1,289 views
0 votes
2 answers

how to print the current time using python?

print(datetime.datetime.today()) READ MORE

answered Feb 14 in Python by Shashank
• 1,350 points
33 views
+1 vote
1 answer

How to create plots using python matplotlib in IPython notebook?

I think you should try: I used %matplotlib inline in ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 56,160 points
102 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 122 views
+4 votes
6 answers
0 votes
1 answer

How to get textual output when using exceptions in Python?

Hi, the answer is pretty simple.  Without the ...READ MORE

answered Jan 17 in Python by Nymeria
• 3,500 points
13 views