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, 2019 in Python by Anirudh
• 2,080 points
955 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, 2019 by Nymeria
• 3,520 points

Related Questions In Python

0 votes
1 answer

How to save an image locally using Python in which we already know the URL address?

Hi, @Roshni, The following code is used to ...READ MORE

answered Jun 26 in Python by Gitika
• 42,520 points
220 views
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,780 points
356 views
0 votes
1 answer

How to get the latest file in a folder using python?

Hello @kartik,  would suggest using glob.iglob() instead of the glob.glob(), as ...READ MORE

answered May 27 in Python by Niroj
• 68,780 points
1,745 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,480 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,112 views
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, 2019 in Python by Nymeria
• 3,520 points
92 views