Skip to content
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

FbCommand.ExecuteNonQuery return value [DNET927] #852

Closed
firebird-automations opened this issue Jan 20, 2020 · 4 comments
Closed

FbCommand.ExecuteNonQuery return value [DNET927] #852

firebird-automations opened this issue Jan 20, 2020 · 4 comments

Comments

@firebird-automations
Copy link

Submitted by: @cincuranet

The FbCommand.ExecuteNonQuery should return -1 for everything except insert, update, delete, according to "spec".

https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbcommand.executenonquery

"For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1."

Commits: da206eb

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: vNext [ 10915 ]

@viegasfh
Copy link

Hi!

I am executing an INSERT .... RETURNING statement and it is returning -1. Shouldn't it be the number of rows affected?

@cincuranet
Copy link
Member

@viegasfh The "problem" is, that INSERT ... RETURNING Firebird reports as "stored procedure" command type.

@viegasfh
Copy link

OK, thanks! I have added the condition to test it against -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants