-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get the last result set only/number of sets in cursor? #379
Comments
off-topic: Yes, |
Of course, but this is the main question: how to get E. g. I have to write a library function: def get_last_set(query, conn):
pass How to implement it? |
while True:
last_set = cursor.fetchall()
if not cursor.nextset(): break
# Now last_set holds the last set of query result |
It's an explicit solution, but in opposition with your previous offer:
Is it impossible in the current version of the |
@dm-logv What API change for vertica-python do you expect to have? |
@sitingren I expect:
Simply put, I want to know how many times I have to call |
That's not a reasonable change vertica-python can make so far. If you set log level to DEBUG, you will have a better understanding of the mechanism from the log. The simplified mechanism is: When you execute a sql, the server will send a sequence of messages like
As you can see, the Vertica protocol doesn't provide information about how many result sets are there in an execution. At a lower level, there is a
Therefore, |
@sitingren Thank you for the great explanation |
Well, let's talk about multiple statements (again).
It's very easy to get
Hey Joe
only:it's not very difficult to get all sets:
(off-topic: what happened with the
rowcount
?)But how to skip
n
first result set without fetching 'em all?Or there is a method to get a number of result sets? (Of course
query.count(';')
looks like a crutch.)The text was updated successfully, but these errors were encountered: