NPGSQL CURSOR MOVE ALL getting affected rows (or row count) -


i trying "rows affected" count following query using npgsql:

declare cursor scroll cursor select * public."table"; move in cursor; 

using pgadmin's sql editor, running query gives: "query returned successfully: 5736 rows affected, 31 msec execution time."

using npgsql:

var transaction = conn.begintransaction(); npgsqlcommand command = new npgsqlcommand("declare cursor scroll cursor select * public.\"partij\"; move in cursor", conn); var count = command.executenonquery(); // valided here cursor did move end of result -- cursor working. transaction.commit(); 

i expecting 5736, count equals -1. can same rows affected count pgadmin using npgsql?

this happening because you're trying affected row count of multistatement command - first statement creates cursor, , second 1 moves (although i'm not sure "rows affected" mean when moving cursor, opposed fetching). try send statements in 2 different commands , affected row of second.

all aside, particular reason using cursors here , not doing select count(*) public."table"?


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -