Skip to content

Call to a stored procedure that returns an empty result set also fails to return OUTPUT parameters and the return value #1187

Answered by gordthompson
artgoldberg asked this question in Q&A
Discussion options

You must be logged in to vote

If the query returns an empty list then rows is a "falsy" value:

>>> rows = [("gord",)]
>>> bool(rows)
True
>>> rows = []
>>> bool(rows)
False

That will cause your while rows: loop to exit.

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@artgoldberg
Comment options

@artgoldberg
Comment options

Comment options

You must be logged in to vote
2 replies
@gordthompson
Comment options

@artgoldberg
Comment options

Answer selected by gordthompson
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants