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

skip\take problems with oracle in new versions #2669

Closed
treschev opened this issue Dec 3, 2020 · 4 comments · Fixed by #2670
Closed

skip\take problems with oracle in new versions #2669

treschev opened this issue Dec 3, 2020 · 4 comments · Fixed by #2670
Assignees
Labels
status: has-pr There is active PR for issue
Milestone

Comments

@treschev
Copy link

treschev commented Dec 3, 2020

H1!
We have a problems with lin2db library when using skip\take methods (latest versions).
when library builds expression (oracle query) - it increments variable name.

using LinqToDB;

query =  query.Skip( 100 ); // query - IQueryable<T>

transforms to Oracle query:

DECLARE @skip_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1 Int32
...
WHERE
			ROWNUM <= :skip_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1

and then query catch an exception like 'too long variable name'.

In prev version (<3) library build expression:

DECLARE @skip Int32
...
WHERE
			ROWNUM <= :skip

Environment details

linq2db version: 3.0.1 >=
Database Server: Oracle
Database Provider: OracleManagedDataAccess
Operating system: Windows
.NET Framework: 4.7

what can we do with that problem? Can u fix it?

@MaceWindu MaceWindu added this to the 3.2.0 milestone Dec 4, 2020
@sdanyliv
Copy link
Member

sdanyliv commented Dec 4, 2020

Yeah, I have found this bug also. Will be fixed in the next release.

@sdanyliv
Copy link
Member

sdanyliv commented Dec 4, 2020

@treschev, as a workaround try to set the following configuration value:

Common.Configuration.Linq.ParameterizeTakeSkip = false;

@treschev
Copy link
Author

treschev commented Dec 7, 2020

thx for ur answers!
we`ll try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: has-pr There is active PR for issue
Development

Successfully merging a pull request may close this issue.

3 participants