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

Oracle.EntityFrameworkCore update statement and checking rows affected #180

Open
SierraNL opened this issue Jun 16, 2021 · 4 comments
Open

Comments

@SierraNL
Copy link

When creating an update the following SQL is generated:

DECLARE
v_RowCount INTEGER;
BEGIN
UPDATE "MyTable" SET "Processed" = :p0, "Updated" = :p1
WHERE "Id" = :p2 AND "Type" = :p3 AND "MessageId" = :p4;
v_RowCount := SQL%ROWCOUNT;
OPEN :cur1 FOR SELECT v_RowCount FROM DUAL;
 
END;

This code is not efficient because it requires context switching and setting up a new cursor.

is there no other way within the framework that can process the return value of the UPDATE statement?

@alexkeh
Copy link
Member

alexkeh commented Jun 16, 2021

If Microsoft introduces a SaveChanges API in EF Core that doesn't require returning the number of rows to the database, then neither Oracle nor any other provider writer would have to retrieve this info.

@SierraNL
Copy link
Author

Ok clear, but isn't it possible to return the SQL%ROWCOUNT without the cursor?

@alexkeh
Copy link
Member

alexkeh commented Jun 17, 2021

Good idea! We'll review whether this idea works. Thanks for the suggestion.

@alexkeh
Copy link
Member

alexkeh commented Jun 27, 2021

@SierraNL I've created a formal enhancement request (33050516) within Oracle's bug/ER tracking system to have a developer try this out.

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