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

Rationalize the UPDATE ... RETURNING statement.executeQuery() behaviour [JDBC389] #431

Closed
firebird-automations opened this issue Apr 8, 2015 · 2 comments

Comments

@firebird-automations
Copy link

Submitted by: Wiesław Poszewiecki (wiesiek)

I am using Jaybird 2.2.7
I was trying to use
UPDATE ... RETURNING....
I used
"....
ResultSet rset = statement.executeQuery();
boolean test=rset.next();
.."
I expected test to be false in the case that update
does not affect any rows.
This differs from the PostgresSQL behaviour which I think is correct.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

I am not sure if I can fix this. UPDATE ... RETURNING ... and friends are treated as executable procedures in Firebird (and because of that it can only be used for singleton updates). The way these are executed always produces a row, even when nothing was updated and the row is empty (all null).

I initially thought to check the update count, but that is not possible because for example actual executable procedures (which are indiscernible from UPDATE ... RETURNING ...) might have a zero update count even though they produce a result.

I will check with the core developers if I am missing an option.

@firebird-automations
Copy link
Author

Commented by: Wiesław Poszewiecki (wiesiek)

For my particular purpose this may stay as it is.

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

2 participants